From 580374922b8d8c0be596432df6933bcb49d9a516 Mon Sep 17 00:00:00 2001 From: Caroline Larimore Date: Thu, 25 Jul 2024 13:21:44 -0700 Subject: Rename host config files --- hosts/c-pc/configuration.nix | 4 +- hosts/c-pc/hardware-configuration.nix | 58 ----------------------------- hosts/c-pc/hardware.nix | 58 +++++++++++++++++++++++++++++ hosts/c-pc/network.nix | 26 +++++++++++++ hosts/c-pc/networking.nix | 26 ------------- hosts/copenhagen/configuration.nix | 2 +- hosts/copenhagen/hardware-configuration.nix | 55 --------------------------- hosts/copenhagen/hardware.nix | 55 +++++++++++++++++++++++++++ 8 files changed, 142 insertions(+), 142 deletions(-) delete mode 100644 hosts/c-pc/hardware-configuration.nix create mode 100644 hosts/c-pc/hardware.nix create mode 100644 hosts/c-pc/network.nix delete mode 100644 hosts/c-pc/networking.nix delete mode 100644 hosts/copenhagen/hardware-configuration.nix create mode 100644 hosts/copenhagen/hardware.nix diff --git a/hosts/c-pc/configuration.nix b/hosts/c-pc/configuration.nix index fd25a36..6b290c1 100644 --- a/hosts/c-pc/configuration.nix +++ b/hosts/c-pc/configuration.nix @@ -2,8 +2,8 @@ { imports = [ - ./hardware-configuration.nix - ./networking.nix + ./hardware.nix + ./network.nix ../../core ../../roles ]; diff --git a/hosts/c-pc/hardware-configuration.nix b/hosts/c-pc/hardware-configuration.nix deleted file mode 100644 index 020dab5..0000000 --- a/hosts/c-pc/hardware-configuration.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ config, lib, pkgs, modulesPath, ... }: - -{ - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - 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" ]; - - 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"; device = "zpool/root"; }; - "/home" = { fsType = "zfs"; device = "zpool/home"; }; - "/persist" = { fsType = "zfs"; device = "zpool/persist"; neededForBoot = true; }; - "/secrets" = { fsType = "zfs"; device = "zpool/secure/secrets"; neededForBoot = true; }; - "/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; -} diff --git a/hosts/c-pc/hardware.nix b/hosts/c-pc/hardware.nix new file mode 100644 index 0000000..020dab5 --- /dev/null +++ b/hosts/c-pc/hardware.nix @@ -0,0 +1,58 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + 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" ]; + + 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"; device = "zpool/root"; }; + "/home" = { fsType = "zfs"; device = "zpool/home"; }; + "/persist" = { fsType = "zfs"; device = "zpool/persist"; neededForBoot = true; }; + "/secrets" = { fsType = "zfs"; device = "zpool/secure/secrets"; neededForBoot = true; }; + "/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; +} diff --git a/hosts/c-pc/network.nix b/hosts/c-pc/network.nix new file mode 100644 index 0000000..da8e074 --- /dev/null +++ b/hosts/c-pc/network.nix @@ -0,0 +1,26 @@ +{ ... }: + +{ + networking = { + hostName = "c-pc"; + hostId = "23ce94ff"; + + useDHCP = true; + + wireless = { + enable = true; + + environmentFile = "/persist/secrets/wireless.env"; + networks = { + "The Dwyers".psk = "@PSK@"; + }; + }; + + firewall = { + enable = false; + + allowedTCPPorts = [ 8096 50000 ]; + allowedUDPPorts = [ ]; + }; + }; +} diff --git a/hosts/c-pc/networking.nix b/hosts/c-pc/networking.nix deleted file mode 100644 index da8e074..0000000 --- a/hosts/c-pc/networking.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ ... }: - -{ - networking = { - hostName = "c-pc"; - hostId = "23ce94ff"; - - useDHCP = true; - - wireless = { - enable = true; - - environmentFile = "/persist/secrets/wireless.env"; - networks = { - "The Dwyers".psk = "@PSK@"; - }; - }; - - firewall = { - enable = false; - - allowedTCPPorts = [ 8096 50000 ]; - allowedUDPPorts = [ ]; - }; - }; -} diff --git a/hosts/copenhagen/configuration.nix b/hosts/copenhagen/configuration.nix index 2b36664..f89d04b 100644 --- a/hosts/copenhagen/configuration.nix +++ b/hosts/copenhagen/configuration.nix @@ -2,7 +2,7 @@ { imports = [ - ./hardware-configuration.nix + ./hardware.nix ../../core ../../roles ]; diff --git a/hosts/copenhagen/hardware-configuration.nix b/hosts/copenhagen/hardware-configuration.nix deleted file mode 100644 index 061700b..0000000 --- a/hosts/copenhagen/hardware-configuration.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ 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" "usbhid" "usb_storage" "sd_mod" ]; - 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"; }; - "/home" = { fsType = "zfs"; device = "zpool/home"; }; - "/persist" = { fsType = "zfs"; device = "zpool/persist"; neededForBoot = true; }; - "/secrets" = { fsType = "zfs"; device = "zpool/secrets"; neededForBoot = true; }; - "/nix" = { fsType = "zfs"; device = "zpool/nix"; }; - - "/boot" = { fsType = "vfat"; device = "/dev/disk/by-uuid/DF61-E3BD"; }; - - "/mnt/old" = { fsType = "ext4"; device = "/dev/disk/by-label/box"; }; - }; - - swapDevices = [ ]; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/hosts/copenhagen/hardware.nix b/hosts/copenhagen/hardware.nix new file mode 100644 index 0000000..061700b --- /dev/null +++ b/hosts/copenhagen/hardware.nix @@ -0,0 +1,55 @@ +{ 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" "usbhid" "usb_storage" "sd_mod" ]; + 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"; }; + "/home" = { fsType = "zfs"; device = "zpool/home"; }; + "/persist" = { fsType = "zfs"; device = "zpool/persist"; neededForBoot = true; }; + "/secrets" = { fsType = "zfs"; device = "zpool/secrets"; neededForBoot = true; }; + "/nix" = { fsType = "zfs"; device = "zpool/nix"; }; + + "/boot" = { fsType = "vfat"; device = "/dev/disk/by-uuid/DF61-E3BD"; }; + + "/mnt/old" = { fsType = "ext4"; device = "/dev/disk/by-label/box"; }; + }; + + swapDevices = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} -- cgit v1.2.3