Skip to content

Commit

Permalink
Fixed the missing encrypted swap by editing hardware.nix manually for
Browse files Browse the repository at this point in the history
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....
  • Loading branch information
jwyuen committed Jul 14, 2024
1 parent 84e8059 commit d9e6950
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 5 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 5 additions & 1 deletion nix-config/hosts/nix-lappy/hardware.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d9e6950

Please sign in to comment.