# 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" "usb_storage" "sd_mod" ];
  boot.initrd.kernelModules = [ ];
  boot.kernelModules = [ "kvm-amd" "amdgpu" ];
  boot.extraModulePackages = [ ];
  boot.kernelParams = [
    "nohibernate"
  ];

  # Fix touchpad
  # https://discourse.nixos.org/t/touchpad-click-not-working/12276
  #boot.kernelParams = [ "psmouse.synaptics_intertouch=0" ];  #! Doesn't work

  fileSystems."/" =
    { device = "/dev/disk/by-uuid/244e07c7-206e-4d24-a9a5-9fcaec1d2762";
      fsType = "ext4";
    };

  boot.initrd.luks.devices."luks-8e2cd705-5126-4ca3-8e18-2a04a4a4a3c6".device = "/dev/disk/by-uuid/8e2cd705-5126-4ca3-8e18-2a04a4a4a3c6";

  fileSystems."/boot/efi" =
    { device = "/dev/disk/by-uuid/CAB0-3D7D";
      fsType = "vfat";
    };

  swapDevices =
    [ { device = "/dev/disk/by-uuid/54b1c0cd-770d-42cb-b562-661692fbf201"; }
    ];

  # Setup keyfile.
  boot.initrd = {
    secrets = {
      "/crypto_keyfile.bin" = null;
    };
  };

  # Enable swap on LUKS.
  boot.initrd.luks.devices."luks-bfe69e52-7676-4bcd-8c5a-0a5dcd247146".device = "/dev/disk/by-uuid/bfe69e52-7676-4bcd-8c5a-0a5dcd247146";
  boot.initrd.luks.devices."luks-bfe69e52-7676-4bcd-8c5a-0a5dcd247146".keyFile = "/crypto_keyfile.bin";

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

  hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;

  # Enable bluetooth.
  hardware.bluetooth.enable = true;
}
