# 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")
  ];

  # Bootloader.
  # boot.loader.systemd-boot.enable = true; Disabled for Grub
  boot.loader = {
    efi.canTouchEfiVariables = true;
    grub = {
      enable = true;
      devices = [ "nodev" ];
      efiSupport = true;
      useOSProber = true;
    };
  };

  boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
  boot.initrd.kernelModules = [ "i2c-dev" "i2c-piix4" ];
  boot.kernel.sysctl."net.ipv4.ip_forward" = 1; # Added for Tailscale
  boot.kernel.sysctl."net.ipv6.conf.enp4s0.disable_ipv6" = true;
  boot.kernel.sysctl."net.ipv6.conf.wlp5s0.disable_ipv6" = true;
  boot.kernel.sysctl."net.ipv6.conf.br0.disable_ipv6" = true;
  boot.kernelModules = [ "kvm-intel" ];
  boot.extraModulePackages = [ ];
  # boot.kernelPackages = pkgs.linuxKernel.kernels.linux_6_12;

  fileSystems."/" =
    { device = "/dev/disk/by-uuid/34b5e875-d066-49f9-9809-7a68d93406b3";
      fsType = "ext4";
    };

  fileSystems."/boot" =
    { device = "/dev/disk/by-uuid/A476-222E";
      fsType = "vfat";
      options = [ "fmask=0077" "dmask=0077" ];
    };

  swapDevices =
    [ { device = "/dev/disk/by-uuid/9a2af991-81ca-4748-9190-e8a1cc2b3b95"; }
    ];

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

  nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
  hardware = {
    bluetooth.enable = true; # enables support for Bluetooth
    bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot
    cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
    # opengl.setLdLibraryPath = true; # Invalid option
    nvidia-container-toolkit = {
      enable = true;
    };
  };
}
