diff --git a/hosts/hades/boot-config.nix b/hosts/hades/boot-config.nix new file mode 100644 index 0000000..5bb158b --- /dev/null +++ b/hosts/hades/boot-config.nix @@ -0,0 +1,42 @@ +{ inputs, outputs, config, lib, pkgs, ... }: + +{ + + imports = [ + + ]; + + # Enable swap on luks + boot = { + loader = { + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot/efi"; + }; + #systemd-boot = { + #enable = false; + #configurationLimit = 10; + #}; + grub = { + enable = true; + #efiSupport = true; + #efiInstallAsRemovable = true; + device = "/dev/sdd"; + useOSProber = true; + enableCryptodisk = true; + }; + }; + initrd = { + systemd.enable = true; + secrets = { + "/boot/crypto_keyfile.bin" = null; + }; + luks = { + #devices."luks-3de671ef-22a3-4f28-9251-a0687ab44f96".keyFile = "/boot/crypto_keyfile.bin"; + # device = "/dev/disk/by-uuid/DISK_UUID"; + # keyfile = "/crypto_keyfile.bin"; + }; + }; + }; + +} diff --git a/hosts/hades/configuration.nix b/hosts/hades/configuration.nix index dad2f34..aa1cdeb 100644 --- a/hosts/hades/configuration.nix +++ b/hosts/hades/configuration.nix @@ -11,39 +11,6 @@ ]; - # Enable swap on luks - boot = { - loader = { - efi = { - canTouchEfiVariables = true; - efiSysMountPoint = "/boot/efi"; - }; - #systemd-boot = { - #enable = false; - #configurationLimit = 10; - #}; - grub = { - #enable = true; - #efiSupport = true; - #efiInstallAsRemovable = true; - #device = "/dev/sdd"; - #useOSProber = true; - #enableCryptodisk = true; - }; - }; - initrd = { - systemd.enable = true; - secrets = { - "/boot/crypto_keyfile.bin" = null; - }; - luks = { - #devices."luks-3de671ef-22a3-4f28-9251-a0687ab44f96".keyFile = "/boot/crypto_keyfile.bin"; - # device = "/dev/disk/by-uuid/DISK_UUID"; - # keyfile = "/crypto_keyfile.bin"; - }; - }; - }; - services.fstrim.enable = true; # powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; diff --git a/hosts/hades/hardware-configuration.nix b/hosts/hades/hardware-configuration.nix index 61c4161..dc20613 100644 --- a/hosts/hades/hardware-configuration.nix +++ b/hosts/hades/hardware-configuration.nix @@ -4,10 +4,10 @@ { config, lib, pkgs, modulesPath, ... }: { - imports = - [ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + ./boot-config.nix + ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; boot.initrd.kernelModules = [ ];