Auto-commit: 2026-01-05 20:23:10
This commit is contained in:
27
modules/core/nvidia.nix
Normal file
27
modules/core/nvidia.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.my;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf cfg.nvidia.enable {
|
||||
services.xserver.videoDrivers = lib.optionals cfg.nvidia.enable ["nvidia"];
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
powerManagement.enable = true;
|
||||
powerManagement.finegrained = false;
|
||||
open = true;
|
||||
nvidiaSettings = cfg.desktop.enable;
|
||||
# Optionally, you may need to select the appropriate driver version for your specific GPU.
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
};
|
||||
hardware.nvidia-container-toolkit.enable = config.virtualisation.docker.enable;
|
||||
environment.systemPackages = with pkgs; [
|
||||
nvidia_oc
|
||||
nvidia-vaapi-driver
|
||||
]
|
||||
++ lib.optionals config.virtualisation.docker.enable [
|
||||
nvidia-docker
|
||||
nvidia-container-toolkit
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user