2021-10-18 00:13:22 +02:00
|
|
|
{ config, pkgs, lib, secret, ... }:
|
2021-09-14 21:59:53 +02:00
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.magic_rb.hardware.blowhole;
|
|
|
|
in {
|
|
|
|
options.magic_rb.hardware.blowhole = mkEnableOption "Enable blowhole.";
|
|
|
|
|
|
|
|
config = mkIf cfg {
|
|
|
|
boot = {
|
2021-10-18 00:13:22 +02:00
|
|
|
supportedFilesystems = [ "zfs" ];
|
|
|
|
initrd.availableKernelModules = [
|
|
|
|
"xhci_pci"
|
|
|
|
"ahci"
|
|
|
|
"usbhid"
|
|
|
|
"usb_storage"
|
|
|
|
"sd_mod"
|
|
|
|
"nvme"
|
|
|
|
];
|
|
|
|
zfs.enableUnstable = true;
|
2021-12-22 23:54:30 +01:00
|
|
|
kernelPackages = pkgs.zfsUnstable.latestCompatibleLinuxPackages;
|
2021-09-14 21:59:53 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems = {
|
2021-10-18 00:13:22 +02:00
|
|
|
"/boot" =
|
2021-09-14 21:59:53 +02:00
|
|
|
{
|
2021-10-18 00:13:22 +02:00
|
|
|
device = "/dev/disk/by-uuid/738acc32-3e2e-4986-987c-40264153d5bf";
|
2021-09-14 21:59:53 +02:00
|
|
|
fsType = "ext4";
|
|
|
|
};
|
2021-10-18 00:13:22 +02:00
|
|
|
"/boot/EFI" =
|
|
|
|
{
|
|
|
|
device = "/dev/disk/by-uuid/246F-0E65";
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
|
|
|
"/" =
|
|
|
|
{
|
|
|
|
device = "blowhole-zpool/local/root";
|
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
"/nix" =
|
|
|
|
{
|
|
|
|
device = "blowhole-zpool/local/nix";
|
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
"/var/nfs" =
|
|
|
|
{
|
|
|
|
device = "/dev/disk/by-uuid/e06f6d2c-e434-4eec-b00d-b13c1ecc96f0";
|
|
|
|
fsType = "btrfs";
|
|
|
|
options =
|
|
|
|
[ "subvol=/nfs"
|
|
|
|
"noatime"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
"/old-root" =
|
|
|
|
{
|
|
|
|
device = "/dev/disk/by-uuid/e06f6d2c-e434-4eec-b00d-b13c1ecc96f0";
|
|
|
|
fsType = "btrfs";
|
|
|
|
options =
|
|
|
|
[ "subvol=/arch"
|
|
|
|
"noatime"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
"/var/lib/nomad" =
|
|
|
|
{
|
|
|
|
device = "/old-root/var/lib/nomad";
|
|
|
|
options = singleton "bind";
|
|
|
|
};
|
|
|
|
"/var/secrets" =
|
|
|
|
{
|
|
|
|
device = "blowhole-zpool/persist/secrets";
|
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
"/var/lib/consul" =
|
|
|
|
{
|
|
|
|
device = "/old-root/var/lib/consul";
|
|
|
|
options = singleton "bind";
|
|
|
|
};
|
|
|
|
"/var/lib/vault" =
|
|
|
|
{
|
|
|
|
device = "/old-root/var/lib/vault";
|
|
|
|
options = singleton "bind";
|
|
|
|
};
|
|
|
|
} // secret.mounts.blowhole;
|
2021-09-14 21:59:53 +02:00
|
|
|
};
|
|
|
|
}
|