move grub and full-disk-encryption into seperate files
This commit is contained in:
parent
21f2b0634c
commit
82f3a79787
7 changed files with 40 additions and 89 deletions
13
modules/grub.nix
Normal file
13
modules/grub.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
||||
|
||||
boot.loader.systemd-boot.enable = false;
|
||||
boot.loader.grub = {
|
||||
enable = true;
|
||||
version = 2;
|
||||
device = "nodev";
|
||||
efiSupport = true;
|
||||
configurationLimit = 5;
|
||||
};
|
||||
}
|
15
modules/luks.nix
Normal file
15
modules/luks.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
let
|
||||
secretsFile = "/root.key";
|
||||
in
|
||||
{
|
||||
boot.loader.grub.enableCryptodisk = true;
|
||||
|
||||
# enable passing of keyfile between grub and initrd
|
||||
boot.initrd.luks.devices."cryptroot" = {
|
||||
fallbackToPassword = true;
|
||||
keyFile = secretsFile;
|
||||
};
|
||||
|
||||
# copy the secret into the additional initramfs. `null` means same path
|
||||
boot.initrd.secrets."${secretsFile}" = null;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue