refactor: centralise all modules
This commit is contained in:
parent
1989535535
commit
6c60cd8e8b
70 changed files with 151 additions and 188 deletions
46
configs/hardware/nvidia.nix
Normal file
46
configs/hardware/nvidia.nix
Normal file
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
# Accept the license by default; needed for some packages.
|
||||
nixpkgs.config.nvidia.acceptLicense = true;
|
||||
nix.settings = {
|
||||
substituters = [ "https://cuda-maintainers.cachix.org" ];
|
||||
trusted-public-keys = [
|
||||
"cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E="
|
||||
];
|
||||
};
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
environment.variables = {
|
||||
GBM_BACKEND = "nvidia-drm";
|
||||
LIBVA_DRIVER_NAME = "nvidia";
|
||||
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
|
||||
};
|
||||
hardware = {
|
||||
enableRedistributableFirmware = true;
|
||||
nvidia-container-toolkit.enable = true;
|
||||
graphics = {
|
||||
enable = true;
|
||||
package = inputs.hyprland.inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}.mesa;
|
||||
extraPackages = with pkgs; [
|
||||
nvidia-vaapi-driver # hardware acceleration
|
||||
];
|
||||
};
|
||||
nvidia = {
|
||||
modesetting.enable = true;
|
||||
open = false;
|
||||
nvidiaSettings = true;
|
||||
nvidiaPersistenced = true;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.latest;
|
||||
};
|
||||
};
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvidia"
|
||||
"nvidia_modeset"
|
||||
"nvidia_uvm"
|
||||
"nvidia_drm"
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue