From e8077fde966e051fc449fffcfa061c7f7edc47b0 Mon Sep 17 00:00:00 2001 From: Caroline Larimore Date: Mon, 14 Apr 2025 19:01:38 -0700 Subject: migration: finalize --- systems/x86_64-linux/c-pc/hardware.nix | 58 ++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 systems/x86_64-linux/c-pc/hardware.nix (limited to 'systems/x86_64-linux/c-pc/hardware.nix') diff --git a/systems/x86_64-linux/c-pc/hardware.nix b/systems/x86_64-linux/c-pc/hardware.nix new file mode 100644 index 0000000..8f7f8cd --- /dev/null +++ b/systems/x86_64-linux/c-pc/hardware.nix @@ -0,0 +1,58 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + boot = { + loader.grub = { + enable = true; + + useOSProber = true; + + zfsSupport = true; + efiSupport = true; + efiInstallAsRemovable = true; + + mirroredBoots = [ + { devices = [ "nodev" ]; path = "/boot"; } + ]; + }; + + initrd = { + availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; + kernelModules = [ "amdgpu" ]; + + #TODO: re-enable impermanence + # 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-amd" ]; + extraModulePackages = [ ]; + + supportedFilesystems = [ "ntfs" ]; + }; + + fileSystems = { + "/" = { fsType = "zfs"; neededForBoot = true; device = "zpool/root"; }; + "/nix" = { fsType = "zfs"; neededForBoot = true; device = "zpool/nix"; }; + "/home" = { fsType = "zfs"; neededForBoot = true; device = "zpool/home"; }; + "/persist" = { fsType = "zfs"; neededForBoot = true; device = "zpool/persist"; }; + "/persist/secure" = { fsType = "zfs"; neededForBoot = true; device = "zpool/secure/persist"; }; + "/secrets" = { fsType = "zfs"; neededForBoot = true; device = "zpool/secure/secrets"; }; + + "/boot" = { fsType = "vfat"; device = "/dev/disk/by-uuid/12CE-A600"; }; + + "/mnt/4tb" = { fsType = "ext4"; device = "/dev/disk/by-label/4tb"; }; + }; + + swapDevices = [ ]; + + hardware.enableRedistributableFirmware = true; + hardware.cpu.amd.updateMicrocode = true; + + nixpkgs.hostPlatform = "x86_64-linux"; +} -- cgit v1.2.3