refactor(treewide)
This commit is contained in:
parent
25d48ac2ac
commit
c4fc882042
99 changed files with 634 additions and 477 deletions
51
nixos/modules/host/hardware/gpu/nvidia.nix
Normal file
51
nixos/modules/host/hardware/gpu/nvidia.nix
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
gpu = config.ooknet.host.hardware.gpu;
|
||||
inherit (lib) mkIf mkDefault;
|
||||
inherit (builtins) elem;
|
||||
production = config.boot.kernelPackages.nvidiaPackages.production;
|
||||
# beta = config.boot.kernelPackages.nvidiaPackages.beta;
|
||||
in
|
||||
|
||||
{
|
||||
# TODO: make option to choose nvidia package
|
||||
config = mkIf (elem gpu.type ["nvidia"]) {
|
||||
hardware = {
|
||||
nvidia = {
|
||||
open = mkDefault true;
|
||||
package = production;
|
||||
forceFullCompositionPipeline = true;
|
||||
nvidiaSettings = false;
|
||||
nvidiaPersistenced = true;
|
||||
modesetting.enable = true;
|
||||
powerManagement = {
|
||||
enable = mkDefault true;
|
||||
finegrained = mkDefault false;
|
||||
};
|
||||
};
|
||||
opengl = {
|
||||
extraPackages = with pkgs; [ nvidia-vaapi-driver ];
|
||||
extraPackages32 = with pkgs.pkgsi686Linux; [ nvidia-vaapi-driver ];
|
||||
};
|
||||
};
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
||||
libva
|
||||
libva-utils
|
||||
|
||||
vulkan-loader
|
||||
vulkan-validation-layers
|
||||
vulkan-tools
|
||||
vulkan-extension-layer
|
||||
|
||||
mesa
|
||||
|
||||
nvtopPackages.nvidia
|
||||
];
|
||||
environment.sessionVariables = {
|
||||
LIBVA_DRIVER_NAME = "nvidia";
|
||||
NVD_BACKEND = "direct";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue