# Hardware configuration for john-endesktop
# This file should be regenerated after NixOS installation using:
# nixos-generate-config --show-hardware-config

{ config, lib, pkgs, modulesPath, ... }:

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

  # Boot configuration
  boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
  boot.initrd.kernelModules = [ ];
  boot.kernelModules = [ "kvm-intel" ];
  boot.extraModulePackages = [ ];

  # File systems - these will need to be updated after installation
  # The nvme0n1p5 partition will be formatted as btrfs for NixOS root
  fileSystems."/" = {
    device = "/dev/disk/by-uuid/5f4ad025-bfab-4aed-a933-6638348059e5";
    fsType = "btrfs";
    options = [ "subvol=@" "compress=zstd" "noatime" ];
  };

  fileSystems."/home" = {
    device = "/dev/disk/by-uuid/5f4ad025-bfab-4aed-a933-6638348059e5";
    fsType = "btrfs";
    options = [ "subvol=@home" "compress=zstd" "noatime" ];
  };

  fileSystems."/nix" = {
    device = "/dev/disk/by-uuid/5f4ad025-bfab-4aed-a933-6638348059e5";
    fsType = "btrfs";
    options = [ "subvol=@nix" "compress=zstd" "noatime" ];
  };

  fileSystems."/var/log" = {
    device = "/dev/disk/by-uuid/5f4ad025-bfab-4aed-a933-6638348059e5";
    fsType = "btrfs";
    options = [ "subvol=@log" "compress=zstd" "noatime" ];
  };

  fileSystems."/boot" = {
    # This should match your current EFI partition
    device = "/dev/disk/by-uuid/F5C6-D570";
    fsType = "vfat";
    options = [ "fmask=0022" "dmask=0022" ];
  };

  # ZFS pools - these are imported by ZFS, not managed by fileSystems
  # The pools should be imported automatically via boot.zfs.extraPools
  # /media and /swarmvols will be mounted by ZFS

  # No swap needed - 23GB RAM is sufficient for this NFS/ZFS server
  swapDevices = [ ];

  # CPU microcode
  hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;

  # Networking
  networking.useDHCP = lib.mkDefault true;
}
