diff options
| author | Caroline Larimore <caroline@larimo.re> | 2024-07-25 20:02:01 -0700 |
|---|---|---|
| committer | Caroline Larimore <caroline@larimo.re> | 2024-07-25 20:02:01 -0700 |
| commit | a1c7956366e8ba7ec38bb8d959929190f554b11b (patch) | |
| tree | 7e8db4b5a36938b04ec276e2ef42bdfd3512e0ff /hosts/phoenix/hardware.nix | |
| parent | bc3b53d11381e1088832dfac22bd26403a58b0f8 (diff) | |
phoenix: create host
Diffstat (limited to 'hosts/phoenix/hardware.nix')
| -rw-r--r-- | hosts/phoenix/hardware.nix | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/hosts/phoenix/hardware.nix b/hosts/phoenix/hardware.nix new file mode 100644 index 0000000..3057c0e --- /dev/null +++ b/hosts/phoenix/hardware.nix @@ -0,0 +1,54 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot = { + loader.grub = { + enable = true; + + zfsSupport = true; + efiSupport = true; + efiInstallAsRemovable = true; + + mirroredBoots = [ + { devices = [ "nodev" ]; path = "/boot"; } + ]; + }; + + initrd = { + availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + kernelModules = [ ]; + + postDeviceCommands = lib.mkAfter '' + zfs rollback -r zpool/root@blank && zfs rollback -r zpool/home@blank + ''; + + postMountCommands = lib.mkAfter '' + chmod u=rw,g=,o= /secrets + ''; + }; + + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; + + supportedFilesystems = [ "ntfs" ]; + }; + + fileSystems = { + "/" = { fsType = "zfs"; device = "zpool/root"; }; + "/nix" = { fsType = "zfs"; device = "zpool/secure/nix"; }; + "/home" = { fsType = "zfs"; device = "zpool/home"; }; + "/persist" = { fsType = "zfs"; device = "zpool/secure/persist"; neededForBoot = true; }; + "/secrets" = { fsType = "zfs"; device = "zpool/secure/secrets"; neededForBoot = true; }; + + "/boot" = { fsType = "vfat"; device = "/dev/disk/by-uuid/C48C-5EE1"; }; + }; + + swapDevices = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} |