2021-04-11 00:25:36 +02:00
|
|
|
{ pkgs, config, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.magic_rb.hardware.omen;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.magic_rb.hardware.omen = mkEnableOption "Enable omen.";
|
|
|
|
|
|
|
|
config = mkIf cfg {
|
|
|
|
boot = {
|
|
|
|
initrd.availableKernelModules = [
|
|
|
|
"xhci_pci"
|
|
|
|
"ahci"
|
|
|
|
"usb_storage"
|
|
|
|
"sr_mod"
|
|
|
|
"rtsx_pci_sdmmc"
|
2021-11-07 23:28:33 +01:00
|
|
|
"nvme"
|
2021-04-11 00:25:36 +02:00
|
|
|
];
|
|
|
|
initrd.kernelModules = [ ];
|
|
|
|
kernelModules = [ "kvm-intel" ];
|
|
|
|
extraModulePackages = [ ];
|
|
|
|
supportedFilesystems = [ "zfs" ];
|
|
|
|
kernelParams = [
|
|
|
|
"zfs.zfs_arc_max=214748368"
|
2021-05-28 09:01:14 +02:00
|
|
|
"intel_pstate=active"
|
2021-04-11 00:25:36 +02:00
|
|
|
];
|
2021-07-22 20:20:01 +02:00
|
|
|
kernelPackages = pkgs.linuxPackages_xanmod;
|
2021-06-14 10:54:27 +02:00
|
|
|
zfs.enableUnstable = true;
|
2021-04-11 00:25:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
hardware.enableRedistributableFirmware = true;
|
2021-07-22 20:20:01 +02:00
|
|
|
hardware.nvidia.package = pkgs.linuxPackages_xanmod.nvidia_x11_beta;
|
2021-04-11 00:25:36 +02:00
|
|
|
|
|
|
|
powerManagement.cpuFreqGovernor = pkgs.lib.mkDefault "schedutil";
|
|
|
|
|
|
|
|
fileSystems = {
|
|
|
|
"/" =
|
2021-11-07 23:28:33 +01:00
|
|
|
{ device = "omen-ssd/local/root";
|
2021-04-11 00:25:36 +02:00
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
|
|
|
|
"/var/lib/secrets" = mkIf config.services.vault-agent.enable
|
|
|
|
{
|
|
|
|
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"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
"/home" =
|
2021-11-07 23:28:33 +01:00
|
|
|
{ device = "omen-ssd/safe/home";
|
2021-04-11 00:25:36 +02:00
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
|
|
|
|
"/nix" =
|
2021-11-07 23:28:33 +01:00
|
|
|
{ device = "omen-ssd/local/nix";
|
2021-04-11 00:25:36 +02:00
|
|
|
fsType = "zfs";
|
|
|
|
};
|
|
|
|
|
|
|
|
"/boot" =
|
2021-11-07 23:28:33 +01:00
|
|
|
{ device = "/dev/disk/by-uuid/078c1885-5e0c-4bb8-bec3-5bf40785f5cd";
|
2021-04-11 00:25:36 +02:00
|
|
|
fsType = "ext4";
|
|
|
|
};
|
|
|
|
|
2021-05-28 09:01:14 +02:00
|
|
|
"/mnt/net/Magic_RB" =
|
|
|
|
{
|
|
|
|
fsType = "nfs";
|
|
|
|
device = "10.64.0.2:/Magic_RB";
|
|
|
|
options = [
|
|
|
|
"noauto"
|
|
|
|
"x-systemd.automount"
|
|
|
|
"x-systemd.device-timeout=10"
|
|
|
|
"timeo=14"
|
|
|
|
"hard"
|
|
|
|
"intr"
|
|
|
|
"noatime"
|
|
|
|
"x-systemd.after=wireguard-wg0.service"
|
|
|
|
];
|
|
|
|
};
|
2021-04-11 00:25:36 +02:00
|
|
|
|
2021-11-07 23:28:33 +01:00
|
|
|
"/boot/EFI" =
|
|
|
|
{ device = "/dev/disk/by-uuid/6F1E-8B1B";
|
2021-04-11 00:25:36 +02:00
|
|
|
fsType = "vfat";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
swapDevices = [
|
|
|
|
{ device = "/dev/disk/by-partlabel/swap-WL157385"; }
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|