2024-03-02 02:59:40 -05:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
modulesPath,
|
2024-03-02 23:36:07 -05:00
|
|
|
pkgs,
|
2024-03-02 02:59:40 -05:00
|
|
|
...
|
|
|
|
}: {
|
|
|
|
nixpkgs.hostPlatform = "x86_64-linux";
|
|
|
|
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
|
|
|
|
|
|
|
|
boot = {
|
2024-03-02 23:36:07 -05:00
|
|
|
kernelModules = ["kvm-intel" "nvidia-uvm"];
|
2024-03-02 02:59:40 -05:00
|
|
|
|
|
|
|
initrd.availableKernelModules = [
|
|
|
|
"xhci_pci"
|
|
|
|
"ahci"
|
|
|
|
"nvme"
|
|
|
|
"usbhid"
|
|
|
|
"usb_storage"
|
|
|
|
"sd_mod"
|
|
|
|
];
|
|
|
|
|
|
|
|
loader = {
|
|
|
|
efi.canTouchEfiVariables = true;
|
|
|
|
timeout = 2;
|
|
|
|
|
|
|
|
systemd-boot = {
|
|
|
|
enable = true;
|
|
|
|
consoleMode = "max";
|
|
|
|
configurationLimit = 30;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
fileSystems = {
|
|
|
|
"/" = {
|
|
|
|
device = "/dev/disk/by-label/NIXROOT";
|
|
|
|
fsType = "btrfs";
|
|
|
|
};
|
|
|
|
|
|
|
|
"/boot" = {
|
|
|
|
device = "/dev/disk/by-label/NIXBOOT";
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
zramSwap.enable = true;
|
|
|
|
|
|
|
|
hardware.cpu.intel.updateMicrocode = config.hardware.enableRedistributableFirmware;
|
2024-03-02 23:36:07 -05:00
|
|
|
|
|
|
|
# NVIDIA settings
|
|
|
|
services.xserver.videoDrivers = ["nvidia"];
|
|
|
|
|
|
|
|
hardware.opengl = {
|
|
|
|
enable = true;
|
|
|
|
driSupport = true;
|
|
|
|
driSupport32Bit = true;
|
|
|
|
|
|
|
|
extraPackages = with pkgs; [
|
|
|
|
vaapiVdpau
|
|
|
|
libvdpau-va-gl
|
|
|
|
nvidia-vaapi-driver
|
|
|
|
];
|
|
|
|
extraPackages32 = with pkgs; [vaapiVdpau];
|
|
|
|
};
|
|
|
|
|
|
|
|
hardware.nvidia = {
|
|
|
|
modesetting.enable = true;
|
|
|
|
|
|
|
|
powerManagement.enable = false;
|
|
|
|
powerManagement.finegrained = false;
|
|
|
|
open = false;
|
|
|
|
nvidiaSettings = false;
|
|
|
|
|
|
|
|
# Vulkan is much more stable in Wayland
|
|
|
|
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
|
|
|
};
|
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
libva-utils
|
|
|
|
nvidia-vaapi-driver
|
|
|
|
nvtop-nvidia
|
|
|
|
pciutils
|
|
|
|
vdpauinfo
|
|
|
|
cudaPackages.cudatoolkit
|
|
|
|
];
|
2024-03-02 02:59:40 -05:00
|
|
|
}
|