mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-12-11 17:31:58 +01:00
648e6cf8c1
Signed-off-by: Magic_RB <magic_rb@redalder.org>
84 lines
2 KiB
Nix
84 lines
2 KiB
Nix
# SPDX-FileCopyrightText: 2022 Richard Brežák <richard@brezak.sk>
|
|
#
|
|
# SPDX-License-Identifier: LGPL-3.0-or-later
|
|
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
secret,
|
|
...
|
|
}:
|
|
with lib; let
|
|
cfg = config.magic_rb.hardware.blowhole;
|
|
in {
|
|
options.magic_rb.hardware.blowhole = mkEnableOption "Enable blowhole.";
|
|
|
|
config = mkIf cfg {
|
|
boot = {
|
|
supportedFilesystems = ["zfs"];
|
|
initrd.availableKernelModules = [
|
|
"xhci_pci"
|
|
"ahci"
|
|
"usbhid"
|
|
"usb_storage"
|
|
"sd_mod"
|
|
"nvme"
|
|
];
|
|
zfs.enableUnstable = true;
|
|
kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
|
|
};
|
|
|
|
hardware.enableRedistributableFirmware = true;
|
|
|
|
fileSystems =
|
|
{
|
|
"/boot" = {
|
|
device = "/dev/disk/by-uuid/738acc32-3e2e-4986-987c-40264153d5bf";
|
|
fsType = "ext4";
|
|
};
|
|
"/" = {
|
|
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 = "blowhole-zpool/persist/nomad";
|
|
fsType = "zfs";
|
|
};
|
|
"/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 or {};
|
|
};
|
|
}
|