2021-08-20 01:21:14 +02:00
|
|
|
{ config, pkgs, lib, secret, ... }:
|
2021-04-11 00:25:36 +02:00
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
defaultBtrfsOpts = [
|
|
|
|
"noatime"
|
|
|
|
"space_cache"
|
|
|
|
];
|
|
|
|
cfg = config.magic_rb.hardware.heater;
|
|
|
|
in {
|
|
|
|
options.magic_rb.hardware.heater = mkEnableOption "Enable heater.";
|
|
|
|
|
|
|
|
config = mkIf cfg {
|
|
|
|
boot = {
|
|
|
|
supportedFilesystems = [ "zfs" ];
|
|
|
|
zfs.enableUnstable = true;
|
|
|
|
|
|
|
|
initrd.availableKernelModules = [
|
|
|
|
"xhci_pci"
|
|
|
|
"ahci"
|
|
|
|
"usbhid"
|
|
|
|
"usb_storage"
|
|
|
|
"sd_mod"
|
|
|
|
"nvme"
|
|
|
|
];
|
|
|
|
initrd.kernelModules = [ "dm-snapshot" ];
|
|
|
|
kernelModules = [ "kvm-amd" ];
|
|
|
|
extraModulePackages = [ ];
|
2021-11-21 16:17:43 +01:00
|
|
|
kernelPackages = pkgs.zfsUnstable.latestCompatibleLinuxPackages;
|
2021-04-11 00:25:36 +02:00
|
|
|
};
|
|
|
|
|
2021-11-21 16:17:43 +01:00
|
|
|
hardware.nvidia.package = pkgs.zfsUnstable.latestCompatibleLinuxPackages.nvidia_x11_beta;
|
2021-07-05 17:03:03 +02:00
|
|
|
|
2021-04-11 00:25:36 +02:00
|
|
|
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
|
|
|
|
|
|
|
fileSystems = {
|
|
|
|
"/" =
|
|
|
|
{
|
|
|
|
device = "heater-zpool/local/root";
|
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
|
|
|
|
"/nix" =
|
|
|
|
{
|
|
|
|
device = "heater-zpool/local/nix";
|
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
|
|
|
|
"/home" =
|
|
|
|
{
|
|
|
|
device = "heater-zpool/safe/home";
|
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
|
|
|
|
"/var/lib/nomad" =
|
|
|
|
{
|
|
|
|
device = "heater-zpool/persist/nomad";
|
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
|
2021-05-09 23:35:48 +02:00
|
|
|
"/var/lib/secrets" = mkIf config.services.vault-agent.enable
|
2021-04-11 00:25:36 +02:00
|
|
|
{
|
2021-05-09 23:35:48 +02:00
|
|
|
device = "tmpfs";
|
|
|
|
fsType = "tmpfs";
|
|
|
|
options = [
|
|
|
|
"mode=0640"
|
|
|
|
"uid=${toString config.users.users.vault-agent.uid}"
|
|
|
|
"gid=${toString config.users.groups.root.gid}"
|
|
|
|
"noexec"
|
|
|
|
"rw"
|
|
|
|
"size=64M"
|
|
|
|
];
|
2021-04-11 00:25:36 +02:00
|
|
|
};
|
|
|
|
|
2021-05-09 23:35:48 +02:00
|
|
|
"/etc/vault-agent" = mkIf config.services.vault-agent.enable
|
|
|
|
{
|
|
|
|
device = "heater-zpool/persist/vault-agent";
|
|
|
|
fsType = "zfs";
|
|
|
|
};
|
2021-04-11 00:25:36 +02:00
|
|
|
|
|
|
|
"/boot" =
|
|
|
|
{
|
|
|
|
device = "/dev/disk/by-uuid/5e590840-9e62-4231-8ac5-e6a27325254d";
|
|
|
|
fsType = "ext4";
|
|
|
|
};
|
|
|
|
|
|
|
|
"/boot/EFI" =
|
|
|
|
{
|
|
|
|
device = "/dev/disk/by-uuid/D381-9D12";
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
|
|
|
|
|
|
|
"/mnt/data1" =
|
|
|
|
{
|
|
|
|
device = "/dev/disk/by-uuid/0ab799ad-c5cf-4a5d-b5cc-7891115eb5e4";
|
|
|
|
fsType = "btrfs";
|
|
|
|
options = [
|
|
|
|
"subvol=/"
|
|
|
|
] ++ defaultBtrfsOpts;
|
|
|
|
};
|
|
|
|
|
|
|
|
"/mnt/data2" =
|
|
|
|
{
|
|
|
|
device = "/dev/mapper/VG_HDD2-Data0";
|
|
|
|
fsType = "ext4";
|
|
|
|
};
|
|
|
|
|
|
|
|
"/mnt/data3" =
|
|
|
|
{
|
|
|
|
device = "/dev/mapper/VG_0-LV_Data0";
|
|
|
|
fsType = "ext4";
|
|
|
|
};
|
|
|
|
|
|
|
|
"/mnt/net/Magic_RB" =
|
|
|
|
{
|
|
|
|
fsType = "nfs";
|
2021-11-17 11:36:33 +01:00
|
|
|
device = "${secret.network.ips.blowhole.ip}:/var/nfs/Magic_RB";
|
2021-08-19 18:23:14 +02:00
|
|
|
options =
|
|
|
|
[ "hard"
|
|
|
|
"async"
|
|
|
|
"tcp"
|
|
|
|
"fsc"
|
|
|
|
];
|
2021-04-11 00:25:36 +02:00
|
|
|
};
|
2021-08-19 18:23:14 +02:00
|
|
|
|
|
|
|
"/var/cache/fscache" =
|
|
|
|
{
|
|
|
|
device = "heater-zpool/persist/cachefilesd";
|
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
services.cachefilesd = {
|
|
|
|
enable = true;
|
|
|
|
cacheDir = "/var/cache/fscache";
|
2021-04-11 00:25:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
# fileSystems."/mnt/win10" =
|
|
|
|
# {
|
|
|
|
# device = "/dev/disk/by-uuid/44394608-0b1b-46b2-9f2e-4e9afde83f5b";
|
|
|
|
# fsType = "ntfs-3g";
|
|
|
|
# options = [
|
|
|
|
# "uid=${builtins.toString config.users.users.main.uid}"
|
|
|
|
# "gid=${builtins.toString config.users.groups.main.gid}"
|
|
|
|
# "umask=002"
|
|
|
|
# ];
|
|
|
|
# };
|
|
|
|
|
|
|
|
swapDevices = [ ];
|
|
|
|
};
|
|
|
|
}
|