cleanup boot files
This commit is contained in:
parent
7eb0a715ea
commit
eca65aa860
6 changed files with 113 additions and 98 deletions
|
|
@ -1,97 +0,0 @@
|
|||
{ pkgs, lib, inputs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
inputs.lanzaboote.nixosModules.lanzaboote
|
||||
];
|
||||
|
||||
boot = {
|
||||
|
||||
#Bootloader
|
||||
environment.systemPackages = [ pkgs.sbctl ];
|
||||
lanzaboote = {
|
||||
enable = true;
|
||||
pkiBundle = "/var/lib/sbctl";
|
||||
autoGenerateKeys.enable = true;
|
||||
autoEnrollKeys.enable = true;
|
||||
};
|
||||
loader.efi.canTouchEfiVariables = true;
|
||||
loader.systemd-boot.enable = lib.mkForce false;
|
||||
|
||||
# Luks Decryption for ZFS
|
||||
initrd = {
|
||||
supportedFilesystems = [ "ext4" "zfs" ];
|
||||
availableKernelModules = [ "hid_apple" ];
|
||||
systemd = {
|
||||
enable = true;
|
||||
fido2.enable = true;
|
||||
emergencyAccess = true;
|
||||
mounts = [
|
||||
{
|
||||
what = "/dev/mapper/zfs-keys";
|
||||
where = "/keys";
|
||||
type = "ext4";
|
||||
options = "ro";
|
||||
}
|
||||
];
|
||||
};
|
||||
luks.fido2Support = false;
|
||||
|
||||
luks.devices."zfs-keys" = {
|
||||
device = "/dev/disk/by-id/nvme-CT1000P2SSD8_2138E5D5DA5A-part2";
|
||||
crypttabExtraOpts = [ "fido2-device=auto" ];
|
||||
};
|
||||
|
||||
systemd.services."zfs-import-nix-root" = {
|
||||
wants = [ "keys.mount" ];
|
||||
after = [ "keys.mount" ];
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services."zfs-import-nix-main" = {
|
||||
wants = [ "keys.mount" ];
|
||||
after = [ "keys.mount" ];
|
||||
};
|
||||
|
||||
boot.zfs.forceImportRoot = false;
|
||||
fileSystems."/" = {
|
||||
device = "nix-root/root";
|
||||
fsType = "zfs";
|
||||
};
|
||||
|
||||
fileSystems."/var/log" = {
|
||||
device = "nix-root/syslog";
|
||||
fsType = "zfs";
|
||||
};
|
||||
|
||||
fileSystems."/nix" = {
|
||||
device = "nix-root/nix";
|
||||
fsType = "zfs";
|
||||
};
|
||||
|
||||
fileSystems."/keys" = {
|
||||
device = "/dev/mapper/zfs-keys";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/home/nyxerinys" = {
|
||||
device = "nix-main/nyxerinys";
|
||||
fsType = "zfs";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/A5CB-B201";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/dev/disk/by-id/nvme-CT1000P2SSD8_2138E5D5DA5A-part3";
|
||||
randomEncryption.enable = true;
|
||||
}
|
||||
];
|
||||
|
||||
}
|
||||
20
hosts/apollo/boot/bootloader.nix
Normal file
20
hosts/apollo/boot/bootloader.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{ inputs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
inputs.lanzaboote.nixosModules.lanzaboote
|
||||
];
|
||||
|
||||
boot = {
|
||||
lanzaboote = {
|
||||
enable = true;
|
||||
pkiBundle = "/var/lib/sbctl";
|
||||
autoGenerateKeys.enable = true;
|
||||
autoEnrollKeys.enable = true;
|
||||
};
|
||||
loader.efi.canTouchEfiVariables = true;
|
||||
loader.systemd-boot.enable = lib.mkForce false;
|
||||
};
|
||||
|
||||
environment.systemPackages = [ pkgs.sbctl ];
|
||||
}
|
||||
9
hosts/apollo/boot/default.nix
Normal file
9
hosts/apollo/boot/default.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./bootloader.nix
|
||||
./encryption.nix
|
||||
./filesystems.nix
|
||||
];
|
||||
}
|
||||
41
hosts/apollo/boot/encryption.nix
Normal file
41
hosts/apollo/boot/encryption.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{ pkgs, lib, inputs, ... }:
|
||||
|
||||
{
|
||||
boot = {
|
||||
# Luks Decryption for ZFS
|
||||
initrd = {
|
||||
supportedFilesystems = [ "ext4" "zfs" ];
|
||||
availableKernelModules = [ "hid_apple" ];
|
||||
systemd = {
|
||||
enable = true;
|
||||
fido2.enable = true;
|
||||
emergencyAccess = true;
|
||||
mounts = [
|
||||
{
|
||||
what = "/dev/mapper/zfs-keys";
|
||||
where = "/keys";
|
||||
type = "ext4";
|
||||
options = "ro";
|
||||
}
|
||||
];
|
||||
};
|
||||
luks.fido2Support = false;
|
||||
|
||||
luks.devices."zfs-keys" = {
|
||||
device = "/dev/disk/by-id/nvme-CT1000P2SSD8_2138E5D5DA5A-part2";
|
||||
crypttabExtraOpts = [ "fido2-device=auto" ];
|
||||
};
|
||||
|
||||
systemd.services."zfs-import-nix-root" = {
|
||||
wants = [ "keys.mount" ];
|
||||
after = [ "keys.mount" ];
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services."zfs-import-nix-main" = {
|
||||
wants = [ "keys.mount" ];
|
||||
after = [ "keys.mount" ];
|
||||
};
|
||||
}
|
||||
42
hosts/apollo/boot/filesystems.nix
Normal file
42
hosts/apollo/boot/filesystems.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
boot.zfs.forceImportRoot = false;
|
||||
fileSystems."/" = {
|
||||
device = "nix-root/root";
|
||||
fsType = "zfs";
|
||||
};
|
||||
|
||||
fileSystems."/var/log" = {
|
||||
device = "nix-root/syslog";
|
||||
fsType = "zfs";
|
||||
};
|
||||
|
||||
fileSystems."/nix" = {
|
||||
device = "nix-root/nix";
|
||||
fsType = "zfs";
|
||||
};
|
||||
|
||||
fileSystems."/keys" = {
|
||||
device = "/dev/mapper/zfs-keys";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/home/nyxerinys" = {
|
||||
device = "nix-main/nyxerinys";
|
||||
fsType = "zfs";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/A5CB-B201";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/dev/disk/by-id/nvme-CT1000P2SSD8_2138E5D5DA5A-part3";
|
||||
randomEncryption.enable = true;
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
{
|
||||
imports = [
|
||||
./boot.nix
|
||||
./boot
|
||||
./hardware.nix
|
||||
./autologin.nix
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue