From d9e6950161f58d1d0d9a5cb49f5de9728d29af2e Mon Sep 17 00:00:00 2001 From: jwy Date: Sun, 14 Jul 2024 19:45:31 -0400 Subject: [PATCH] Fixed the missing encrypted swap by editing hardware.nix manually for nix-lappy host. For some reason though using nixos-generate-config will break this and generate a config that is missing luks unlock for the swap partition. In the install script we disable generating this hardware config as a sort of bandaid solution for now.... --- install.sh | 8 +++++--- nix-config/hosts/nix-lappy/hardware.nix | 6 +++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 0f863601f..f3b9336ad 100755 --- a/install.sh +++ b/install.sh @@ -82,10 +82,12 @@ fc-cache -rf #sed -i "s/name: 'gh0stzk'/name: '$USER'/" "$HOME"/.local/share/startup-page/config.js echo "-----" -echo "Generating The Hardware Configuration" -sudo nixos-generate-config --show-hardware-config > ./nix-config/hosts/$host_name/hardware.nix - +# Exclude nix-lappy host since generating hardware config breaks the encrypted swap for some reason +if [ "$host_name" != "nix-lappy" ]; then + echo "Generating The Hardware Configuration" + sudo nixos-generate-config --show-hardware-config > ./nix-config/hosts/"$host_name"/hardware.nix echo "-----" +fi echo "Now Going To Build $PROJECT_NAME, 🤞" #NIX_CONFIG="experimental-features = nix-command flakes" diff --git a/nix-config/hosts/nix-lappy/hardware.nix b/nix-config/hosts/nix-lappy/hardware.nix index eb5dc5c1a..b495a7f7e 100644 --- a/nix-config/hosts/nix-lappy/hardware.nix +++ b/nix-config/hosts/nix-lappy/hardware.nix @@ -32,7 +32,11 @@ fsType = "vfat"; }; - swapDevices = [ ]; + boot.initrd.luks.devices."luks-aeac6522-d282-44ec-b17f-085c243c52f3".device = "/dev/disk/by-uuid/aeac6522-d282-44ec-b17f-085c243c52f3"; + + swapDevices = + [ { device = "/dev/disk/by-uuid/3562a7a6-bfeb-466d-a683-1da88b01b205"; } + ]; # 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