# 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 = [];
  boot.kernelModules = ["kvm-amd" "i2c-dev" "i2c-piix4"];
  boot.extraModulePackages = [];
  boot.supportedFilesystems = ["btrfs" "ntfs" "zfs"];
  boot.zfs.extraPools = ["drivemecrazy"];

  # 100GB encrypted partitions on multiple disks set up as RAID1
  boot.initrd.luks.devices = {
    "disko-iron-1" = {
      device = "/dev/disk/by-uuid/52795553-38e1-4ec3-bba8-63df295d5d21";
    };
    "disko-nvme-2" = {
      device = "/dev/disk/by-uuid/7c596ce8-b136-4a36-ad32-0ae2bb2130ee";
    };
  };

  networking.hostId = "c9107abe";

  fileSystems."/" = {
    device = "/dev/disk/by-uuid/43258db8-e2c5-4457-9cef-5b308bb1a89f";
    fsType = "btrfs";
    options = ["subvol=root" "compress-force=zstd" "noatime"];
  };

  fileSystems."/home" = {
    device = "/dev/disk/by-uuid/43258db8-e2c5-4457-9cef-5b308bb1a89f";
    fsType = "btrfs";
    options = ["subvol=home" "compress-force=zstd"];
  };

  fileSystems."/nix" = {
    device = "/dev/disk/by-uuid/43258db8-e2c5-4457-9cef-5b308bb1a89f";
    fsType = "btrfs";
    options = ["subvol=nix" "compress-force=zstd" "noatime"];
  };

  fileSystems."/persist" = {
    device = "/dev/disk/by-uuid/43258db8-e2c5-4457-9cef-5b308bb1a89f";
    fsType = "btrfs";
    options = ["subvol=persist" "compress-force=zstd"];
  };

  fileSystems."/var/log" = {
    device = "/dev/disk/by-uuid/43258db8-e2c5-4457-9cef-5b308bb1a89f";
    fsType = "btrfs";
    options = ["subvol=log" "compress-force=zstd"];
    neededForBoot = true;
  };

  fileSystems."/boot" = {
    device = "/dev/disk/by-uuid/5E77-7F02";
    fsType = "vfat";
  };

  fileSystems."/mnt/wolfpack" = {
    device = "/dev/disk/by-uuid/4ad66514-19e1-4811-a46a-bacd0ad87eee";
    fsType = "btrfs";
    options = ["compress-force=zstd"];
  };

  # fileSystems."/mnt/disko" = {
  #   device = "/dev/mapper/disko-iron-1";
  #   encrypted = {
  #     label = "disko-iron-1";
  #   };
  #   fsType = "btrfs";
  #   options = ["compress-force=zstd"];
  # };

  swapDevices = [
    {
      device = "/swap/swapfile";
      size = 24576;
    }
  ];

  # 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.eno1.useDHCP = lib.mkDefault true;

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