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

49 lines
1.5 KiB
Nix
Raw Normal View History

2022-09-18 22:41:17 +00:00
{
config,
pkgs,
...
}: {
boot.supportedFilesystems = ["zfs"];
2022-09-18 19:42:30 +00:00
networking.hostId = "f8616592";
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
2023-03-30 05:57:41 +00:00
boot.loader.efi.efiSysMountPoint = "/boot/efis/nvme-WDC_WDS100T2B0C-00PXH0_21111Y801086-part1";
2022-09-18 22:41:17 +00:00
boot.loader.efi.canTouchEfiVariables = false;
boot.loader.generationsDir.copyKernels = true;
boot.loader.grub.efiInstallAsRemovable = true;
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
boot.loader.grub.copyKernels = true;
boot.loader.grub.efiSupport = true;
boot.loader.grub.zfsSupport = true;
boot.loader.grub.extraPrepareConfig = ''
mkdir -p /boot/efis
for i in /boot/efis/* ; do
(mount | grep -q "$i")
isDirectoryMounted=$?
if (test $isDirectoryMounted -ne 0); then
mount "$i"
fi
done
2022-09-18 19:42:30 +00:00
2022-09-18 22:41:17 +00:00
mkdir -p /boot/efi
# mount /boot/efi
(mount | grep -q /boot/efi)
isDirectoryMounted=$?
if (test $isDirectoryMounted -ne 0); then
mount /boot/efi
fi
2022-09-18 22:41:17 +00:00
'';
boot.loader.grub.extraInstallCommands = ''
ESP_MIRROR=$(mktemp -d)
2023-03-30 05:57:41 +00:00
cp -r /boot/efis/nvme-WDC_WDS100T2B0C-00PXH0_21111Y801086-part1/EFI $ESP_MIRROR
2022-09-18 22:41:17 +00:00
for i in /boot/efis/*; do
cp -r $ESP_MIRROR/EFI $i
done
rm -rf $ESP_MIRROR
'';
boot.loader.grub.devices = [
"/dev/disk/by-id/nvme-WDC_WDS100T2B0C-00PXH0_21111Y801086"
];
users.users.root.initialHashedPassword = "$6$3Ps2Vmff.gUBkiCv$FCeCQjDvNTdWynQU81qtCXFHQht86w4unWNalUgkcyq7lkkI2klzRyTK3dZiQUjIrn8qPKtwJcY9SNdyE8v1L/";
2022-09-18 19:42:30 +00:00
}