From ffbcb9053fc1885cabd0a6a5b10695d75a55403b Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Thu, 22 Jun 2023 09:03:42 +0100 Subject: [PATCH] Add Legion config to flake --- flake.nix | 8 +++++ hosts/Legion/configuration.nix | 28 +++++++++++++++ hosts/Legion/hardware-configuration.nix | 45 +++++++++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 hosts/Legion/configuration.nix create mode 100644 hosts/Legion/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index 614c656c..dc92d290 100644 --- a/flake.nix +++ b/flake.nix @@ -15,6 +15,14 @@ home-manager, }: { nixosConfigurations = { + Legion = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + home-manager.nixosModules.home-manager + ./hosts/Legion/configuration.nix + ./machines/Legion + ]; + }; N0245 = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ diff --git a/hosts/Legion/configuration.nix b/hosts/Legion/configuration.nix new file mode 100644 index 00000000..924c210c --- /dev/null +++ b/hosts/Legion/configuration.nix @@ -0,0 +1,28 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running `nixos-help`). + +{ config, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + nix.extraOptions = '' experimental-features = nix-command flakes ''; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It's perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "23.05"; # Did you read the comment? + +} + diff --git a/hosts/Legion/hardware-configuration.nix b/hosts/Legion/hardware-configuration.nix new file mode 100644 index 00000000..49959b50 --- /dev/null +++ b/hosts/Legion/hardware-configuration.nix @@ -0,0 +1,45 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "mvsas" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/885318de-a7a7-48ad-9a33-9c04e931617a"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/3152-AE82"; + fsType = "vfat"; + }; + + fileSystems."/var/lib" = + { device = "/dev/disk/by-uuid/f3795e93-1c36-4782-b980-1bb0b0bb8551"; + fsType = "btrfs"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/7ef14a7d-085e-449f-9952-404c56352f8d"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp5s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}