From 2692b2dc20031427a608945647243d252b31796b Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 24 Apr 2023 13:05:05 +0200 Subject: [PATCH 1/2] host_001_momo_koeln: fix swap UUID This got changed while debugging boot failures on this host, by re-creating swap. --- .../hardware-configuration.nix | 37 ++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/hosts/host_001_momo_koeln/hardware-configuration.nix b/hosts/host_001_momo_koeln/hardware-configuration.nix index 39e05d60..d3606463 100644 --- a/hosts/host_001_momo_koeln/hardware-configuration.nix +++ b/hosts/host_001_momo_koeln/hardware-configuration.nix @@ -1,6 +1,9 @@ -{ config, pkgs, lib, ... }: - { + config, + pkgs, + lib, + ... +}: { # Use the GRUB 2 boot loader. boot.loader.systemd-boot.enable = false; boot.loader.grub.enable = true; @@ -11,28 +14,28 @@ # Define on which hard drive you want to install Grub. boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only - boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sd_mod" "sr_mod" ]; - boot.initrd.kernelModules = [ "dm-snapshot" ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "virtio_pci" "sd_mod" "sr_mod"]; + boot.initrd.kernelModules = ["dm-snapshot"]; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; boot.initrd.luks.devices."cryptroot" = { device = "/dev/disk/by-uuid/531ee357-5777-498f-abbf-64bb4cff9a14"; }; - fileSystems."/" = - { device = "/dev/disk/by-uuid/f5b3152a-a3bd-46d1-968f-53d50fca921e"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/f5b3152a-a3bd-46d1-968f-53d50fca921e"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/1fd053f8-725b-418d-aed1-aee71dac2b62"; - fsType = "ext4"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/1fd053f8-725b-418d-aed1-aee71dac2b62"; + fsType = "ext4"; + }; - swapDevices = - [ { device = "/dev/disk/by-uuid/46191ecf-244c-4445-b1c0-ae3059871a70"; } - ]; + swapDevices = [ + {device = "/dev/disk/by-uuid/967d1933-131d-4b56-8aa9-15c11ff940c9";} + ]; networking = { defaultGateway = "80.244.242.1"; From db53f9f1be2e00ca2974948b570d3e3e46f0c17a Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 24 Apr 2023 13:13:12 +0200 Subject: [PATCH 2/2] host_001_momo_koeln: fix initrd kernelModules boot.initrd.kernelModules overrides boot.initrd.availableKernelModules and forces the initrd to load only those modules. This leads to the host being unbootable in this case because of missing required modules. availableKernelModules is the correct place for desired modules. This got fixed during a debugging session of hensoko and teutat3s, but not implemented in nix code until now. --- hosts/host_001_momo_koeln/hardware-configuration.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hosts/host_001_momo_koeln/hardware-configuration.nix b/hosts/host_001_momo_koeln/hardware-configuration.nix index d3606463..b1b7611c 100644 --- a/hosts/host_001_momo_koeln/hardware-configuration.nix +++ b/hosts/host_001_momo_koeln/hardware-configuration.nix @@ -14,8 +14,8 @@ # Define on which hard drive you want to install Grub. boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only - boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "virtio_pci" "sd_mod" "sr_mod"]; - boot.initrd.kernelModules = ["dm-snapshot"]; + boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "virtio_pci" "sd_mod" "sr_mod" "dm-snapshot"]; + boot.initrd.kernelModules = []; boot.kernelModules = ["kvm-intel"]; boot.extraModulePackages = [];