# Do not modify this file!  It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations.  Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:

{
  imports =
    [ (modulesPath + "/installer/scan/not-detected.nix")
    ];

  boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
  boot.initrd.kernelModules = [ ];
  boot.kernelModules = [ "kvm-intel" ];
  boot.extraModulePackages = [ ];
  boot.initrd.supportedFilesystems = [ "btrfs" "vfat" ];
  boot.kernel.sysctl = { "net.ipv4.conf.wg0.forwarding" = 1; "net.ipv4.conf.eno1.forwarding" = 1; };
  boot.extraModprobeConfig = ''
    options vfio-pci ids=8086:9bc8
    blacklist i915
  '';
  boot.kernelParams = [
   "intel_iommu=on"
  ];

  fileSystems."/" = {
    device = "/dev/disk/by-uuid/0d20b2bf-935c-48c7-bd07-8b81ae7ddbcf";
    fsType = "btrfs";
    options = ["ssd" "discard=async" "noatime" "nodiratime" "compress=zstd" ];
  };

  fileSystems."/srv/nas" = {
    device = "/dev/data_ssd/nas";
    fsType = "btrfs";
    options = ["ssd" "discard=async" "noatime" "nodiratime" "compress=zstd" ];
   };

  fileSystems."/vms" = {
    device = "/dev/data_ssd/vms";
    fsType = "ext4";
    options = ["noatime" "nodiratime"];
   };

  boot.initrd.preLVMCommands = ''
    mkdir -m 0755 /boot-key
    mount -t vfat /dev/nvme0n1p1 /boot-key
    cp /boot-key/lukskey /bootkey
    umount /boot-key
  '';

  boot.initrd.luks.devices."install" = {
    device = "/dev/disk/by-uuid/b029348a-ecb6-4f6b-869a-7255e8556566";
    allowDiscards = true;
    keyFileSize = 4096;
    keyFile = "/bootkey";
  };

  fileSystems."/boot" =
    { device = "/dev/disk/by-uuid/1E13-D81C";
      fsType = "vfat";
    };

  swapDevices = [ ];

  powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
  # high-resolution display
  hardware.video.hidpi.enable = lib.mkDefault true;
}
