75 lines
No EOL
1.6 KiB
Nix
75 lines
No EOL
1.6 KiB
Nix
{ pkgs, lib, inputs, ... }:
|
|
|
|
{
|
|
boot.initrd = {
|
|
supportedFilesystems = [ "ext4" "zfs" ];
|
|
systemd = {
|
|
enable = true;
|
|
fido2.enable = true;
|
|
mounts = [
|
|
{
|
|
what = "/sysroot/keys";
|
|
where = "/keys";
|
|
type = "none";
|
|
options = "bind";
|
|
unitConfig.RequiresMountsFor = "/sysroot/keys";
|
|
requires = [ "sysroot-keys.mount" ];
|
|
after = [ "sysroot-keys.mount" ];
|
|
before = [ "zfs-import-nix-root.service" ];
|
|
}
|
|
];
|
|
};
|
|
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" ];
|
|
};
|
|
};
|
|
|
|
fileSystems."/keys" = {
|
|
device = "/dev/mapper/zfs-keys";
|
|
fsType = "ext4";
|
|
neededForBoot = true;
|
|
};
|
|
|
|
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."/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;
|
|
}
|
|
];
|
|
|
|
} |