# 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 =
    [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
  boot.initrd.kernelModules = [ "usb_storage" ];
  boot.kernelModules = [ "kvm-amd" ];
  boot.extraModulePackages = [ ];
  boot.supportedFilesystems = [ "zfs" "ntfs" "btrfs" ];
  services.zfs.autoScrub.enable = true;
  services.zfs.autoSnapshot.enable = true;

  fileSystems."/" = {
    device = "/dev/disk/by-uuid/034b9530-2c01-4108-9dbb-44557eddf6d5";
    fsType = "ext4";
  };

  fileSystems."/boot" = {
    device = "/dev/disk/by-uuid/9D45-AA14";
    fsType = "vfat";
    options = [ "fmask=0077" "dmask=0077" ];
  };

  boot.initrd.luks.devices = let
    keyFile =
      "/dev/disk/by-id/usb-Kingston_DataTraveler_3.0_60A44C3FB1A2BE91997103B3-0:0";
  in {
    cura = {
      device = "/dev/disk/by-id/ata-WDC_WD30EZRZ-22Z5HB0_WD-WCC4N2RR7YNU-part1";
      allowDiscards = true;
      keyFileSize = 4096;
      keyFile = keyFile;
    };
    curb = {
      device = "/dev/disk/by-id/ata-WDC_WD30EZRZ-22Z5HB0_WD-WCC4N2RR70YJ-part1";
      allowDiscards = true;
      keyFileSize = 4096;
      keyFile = keyFile;
    };
    curc = {
      device = "/dev/disk/by-id/ata-WDC_WD30EZRZ-22Z5HB0_WD-WCC4N2RR7NZT-part1";
      allowDiscards = true;
      keyFileSize = 4096;
      keyFile = keyFile;
    };
    curd = {
      device = "/dev/disk/by-id/ata-WDC_WD30EZRZ-22Z5HB0_WD-WCC4N4FSYUC3-part1";
      allowDiscards = true;
      keyFileSize = 4096;
      keyFile = keyFile;
    };
  };

  services.btrfs.autoScrub.enable = true;
  services.btrfs.autoScrub.interval = "weekly";

  fileSystems."/curr" = {
    device = "/dev/disk/by-uuid/9067ce83-2520-4543-8b7f-38949e1b8b8b";
    fsType = "btrfs";
    options = [ "subvol=base" "compress=zstd" "noatime" ];
  };

  fileSystems."/srv" = {
    device = "/dev/disk/by-uuid/9067ce83-2520-4543-8b7f-38949e1b8b8b";
    fsType = "btrfs";
    options = [ "subvol=base" "compress=zstd" "noatime" ];
  };

  fileSystems."/storage1" = {
    device = "storage1";
    fsType = "zfs";
  };

  swapDevices =
    [{ device = "/dev/disk/by-uuid/f7ce07eb-563c-4c65-b465-b6c1ab88aede"; }];

  # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
  # (the default) this is the recommended approach. When using systemd-networkd it's
  # still possible to use this option, but it's recommended to use it in conjunction
  # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
  networking.useDHCP = lib.mkDefault true;
  # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;

  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
  hardware.cpu.amd.updateMicrocode =
    lib.mkDefault config.hardware.enableRedistributableFirmware;
}
