[NixOS] Put nvidia configuration into a file

This commit is contained in:
Ivan Malison 2024-09-27 13:09:45 -06:00
parent ffb55c157b
commit d62d538562
4 changed files with 18 additions and 2 deletions

View File

@ -59,8 +59,6 @@ makeEnable config "myModules.base" true {
services.locate.enable = true; services.locate.enable = true;
virtualisation.docker.enable = true; virtualisation.docker.enable = true;
hardware.nvidia-container-toolkit.enable = true;
hardware.nvidia.open = false;
hardware.keyboard.zsa.enable = true; hardware.keyboard.zsa.enable = true;

View File

@ -23,6 +23,7 @@
./keybase.nix ./keybase.nix
./nix.nix ./nix.nix
./nixified.ai.nix ./nixified.ai.nix
./nvidia.nix
./options.nix ./options.nix
./plasma.nix ./plasma.nix
./postgres.nix ./postgres.nix

View File

@ -6,6 +6,7 @@
]; ];
features.full.enable = true; features.full.enable = true;
myModules.nvidia.enable = true;
# Needed for now because monitors have different refresh rates # Needed for now because monitors have different refresh rates
myModules.xmonad.picom.vSync.enable = false; myModules.xmonad.picom.vSync.enable = false;
myModules.cache-server = { myModules.cache-server = {

16
nixos/nvidia.nix Normal file
View File

@ -0,0 +1,16 @@
{ config, pkgs, makeEnable, ... }:
makeEnable config "myModules.nvidia" false {
environment.systemPackages = with pkgs; [
nvidia-container-toolkit
];
virtualisation.docker.enableNvidia = true;
hardware.nvidia-container-toolkit.enable = true;
hardware.nvidia.open = false;
hardware.graphics.extraPackages = [ pkgs.linuxPackages.nvidia_x11.out ];
hardware.graphics.extraPackages32 = [ pkgs.linuxPackages.nvidia_x11.lib32 ];
hardware.graphics.enable32Bit = true;
services.xserver = {
videoDrivers = [ "nvidia" ];
};
}