dotfiles/systems/x86_64-linux/carbon/zfs.nix

46 lines
1.7 KiB
Nix
Raw Permalink Normal View History

{pkgs, ...}: {
2022-09-18 19:42:30 +00:00
boot.supportedFilesystems = ["zfs"];
networking.hostId = "b2d25606";
boot.zfs.devNodes = "/dev/disk/by-id";
swapDevices = [
{
device = "/dev/disk/by-id/nvme-SAMSUNG_MZVLW256HEHP-000L7_S35ENX1K539085-part4";
randomEncryption.enable = true;
}
{
device = "/dev/disk/by-id/nvme-WDC_PC_SN520_SDAPTUW-512G_182747800010-part4";
randomEncryption.enable = true;
}
];
systemd.services.zfs-mount.enable = false;
environment.etc."machine-id".source = "/state/etc/machine-id";
environment.etc."zfs/zpool.cache".source = "/state/etc/zfs/zpool.cache";
boot.loader.efi.efiSysMountPoint = "/boot/efis/nvme-SAMSUNG_MZVLW256HEHP-000L7_S35ENX1K539085-part1";
boot.loader.efi.canTouchEfiVariables = false;
##if UEFI firmware can detect entries
#boot.loader.efi.canTouchEfiVariables = true;
boot.loader = {
generationsDir.copyKernels = true;
##for problematic UEFI firmware
grub.efiInstallAsRemovable = true;
grub.enable = true;
grub.copyKernels = true;
grub.efiSupport = true;
grub.zfsSupport = true;
grub.extraInstallCommands = ''
2023-11-03 00:22:32 +00:00
export ESP_MIRROR=$(${pkgs.coreutils}/bin/mktemp -d -p /tmp)
${pkgs.coreutils}/bin/cp -r /boot/efis/nvme-SAMSUNG_MZVLW256HEHP-000L7_S35ENX1K539085-part1/EFI $ESP_MIRROR
2022-09-18 19:42:30 +00:00
for i in /boot/efis/*; do
2023-11-03 00:22:32 +00:00
${pkgs.coreutils}/bin/cp -r $ESP_MIRROR/EFI $i
2022-09-18 19:42:30 +00:00
done
2023-11-03 00:22:32 +00:00
${pkgs.coreutils}/bin/rm -rf $ESP_MIRROR
2022-09-18 19:42:30 +00:00
'';
grub.devices = [
"/dev/disk/by-id/nvme-SAMSUNG_MZVLW256HEHP-000L7_S35ENX1K539085"
"/dev/disk/by-id/nvme-WDC_PC_SN520_SDAPTUW-512G_182747800010"
];
};
users.users.root.initialHashedPassword = "$6$VOzIHqv12iJGQIFl$NQf1GeiGhtdLfZFmtZl4vab.xvtVvI7.5ty9zbMFI2dpmHoFdc6XnGwTlClVe./CbcrsQjtPpt7NKf0dNttcw.";
}