Base of Nix Configuration
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
{ lib, config, ... }:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.within.graphics.nvidia;
|
||||
in
|
||||
{
|
||||
options.within.graphics.nvidia = {
|
||||
enable = mkEnableOption "System nvidia service";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
nixpkgs.config.allowUnfreePredicate =
|
||||
pkg:
|
||||
builtins.elem (lib.getName pkg) [
|
||||
"nvidia-x11"
|
||||
];
|
||||
|
||||
services.xserver.enable = true;
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
hardware.graphics.enable = true;
|
||||
hardware.nvidia = {
|
||||
open = true;
|
||||
nvidiaSettings = false;
|
||||
modesetting.enable = true; # Wayland requirements
|
||||
powerManagement.enable = true;
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user