From be56ab79101e9ac6c9225cba41274cac5bc85aa6 Mon Sep 17 00:00:00 2001 From: serenity-F Date: Thu, 12 Dec 2024 02:58:08 +1000 Subject: [PATCH] more tidying in `hosts/hades` --- hosts/hades/default.nix | 1 - hosts/hades/modules/default.nix | 1 + hosts/hades/modules/hardware.nix | 47 +++++++++++++++++++++----------- 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/hosts/hades/default.nix b/hosts/hades/default.nix index 7755464..80daa10 100755 --- a/hosts/hades/default.nix +++ b/hosts/hades/default.nix @@ -4,7 +4,6 @@ imports = [ ## Host specific config files - ./hardware-configuration.nix ./modules ## Shared 'core' config options diff --git a/hosts/hades/modules/default.nix b/hosts/hades/modules/default.nix index 3ae6508..262b246 100755 --- a/hosts/hades/modules/default.nix +++ b/hosts/hades/modules/default.nix @@ -5,6 +5,7 @@ imports = [ ## Selected host modules for import + ./hardware.nix # hardware configuration ./network.nix # network configuration #./extra.nix # configuration.nix substitute ./zfs.nix # zfs configuration diff --git a/hosts/hades/modules/hardware.nix b/hosts/hades/modules/hardware.nix index 4b1213b..9526d90 100755 --- a/hosts/hades/modules/hardware.nix +++ b/hosts/hades/modules/hardware.nix @@ -1,35 +1,50 @@ # 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, ... }: +{ config, lib, modulesPath, ... }: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot = { + + initrd = { + availableKernelModules = + [ "xhci_pci" "ehci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ]; + + kernelModules = [ "dm-snapshot" ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/efa84ce5-ecd1-46c6-8207-5434919d9f72"; - fsType = "ext4"; }; - boot.initrd.luks.devices."luks-f9de3a25-6f75-4e75-b885-160b58634006".device = "/dev/disk/by-uuid/f9de3a25-6f75-4e75-b885-160b58634006"; + kernelModules = [ "kvm-intel" ]; - swapDevices = [ ]; + extraModulePackages = [ ]; + + }; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/ad648423-7aa4-4f0f-b157-2f6b458130f7"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/552D-851F"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = + [{ device = "/dev/disk/by-uuid/b7ccf8c3-3641-4035-b91f-f7e54c6dd380"; }]; # 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.enp5s0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp8s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + hardware.cpu.intel.updateMicrocode = + lib.mkDefault config.hardware.enableRedistributableFirmware; }