aboutsummaryrefslogtreecommitdiff
path: root/hosts/c-pc/hardware-configuration.nix
diff options
context:
space:
mode:
authorCaroline Larimore <caroline@larimo.re>2024-07-18 23:39:42 -0700
committerCaroline Larimore <caroline@larimo.re>2024-07-18 23:39:42 -0700
commit65174b4b5c05bb143e6681a4cbcd0a95f04987e2 (patch)
tree35383af43f2aa972b316dd12e1d5d1bd5df84086 /hosts/c-pc/hardware-configuration.nix
parent15c5050590415fd64e984e994ec77186918cf7b7 (diff)
Begin modularization!
Diffstat (limited to 'hosts/c-pc/hardware-configuration.nix')
-rw-r--r--hosts/c-pc/hardware-configuration.nix51
1 files changed, 51 insertions, 0 deletions
diff --git a/hosts/c-pc/hardware-configuration.nix b/hosts/c-pc/hardware-configuration.nix
new file mode 100644
index 0000000..c268ff8
--- /dev/null
+++ b/hosts/c-pc/hardware-configuration.nix
@@ -0,0 +1,51 @@
+{ 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" "ahci" "usb_storage" "usbhid" "sd_mod" ];
+ kernelModules = [ "amdgpu" ];
+
+ postDeviceCommands = lib.mkAfter ''
+ zfs rollback -r zpool/root@blank && zfs rollback -r zpool/home@blank
+ '';
+ };
+
+ kernelModules = [ "kvm-amd" ];
+ extraModulePackages = [ ];
+
+ supportedFilesystems = [ "ntfs" ];
+ };
+
+ fileSystems = {
+ "/" = { fsType = "zfs"; device = "zpool/root"; };
+ "/home" = { fsType = "zfs"; device = "zpool/home"; };
+ "/persist" = { fsType = "zfs"; device = "zpool/persist"; };
+ "/nix" = { fsType = "zfs"; device = "zpool/nix"; };
+
+ "/boot" = { fsType = "vfat"; device = "/dev/disk/by-uuid/12CE-A600"; };
+
+ "/mnt/4tb" = { fsType = "ext4"; device = "/dev/disk/by-label/4tb"; };
+ "/mnt/ssd" = { fsType = "ext4"; device = "/dev/disk/by-label/ssd-256"; };
+ };
+
+ swapDevices = [ ];
+
+ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
+ hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
+}