diff --git a/hosts/architect/default.nix b/hosts/architect/default.nix index f5236b3..f31f291 100644 --- a/hosts/architect/default.nix +++ b/hosts/architect/default.nix @@ -125,11 +125,6 @@ in ''; }; - hardware.opengl = { - enable = true; - extraPackages = with pkgs; [ vaapiVdpau ]; - }; - services = { fwupd.enable = true; das_watchdog.enable = true; @@ -156,6 +151,11 @@ in enable = true; path = "/media"; }; + + graphics = { + enable = true; + nvidia = true; + }; }; services = { diff --git a/modules/core/default.nix b/modules/core/default.nix index ea5f08c..f338f34 100644 --- a/modules/core/default.nix +++ b/modules/core/default.nix @@ -1,5 +1,6 @@ {...}: { imports = [ ./media.nix + ./graphics.nix ]; } diff --git a/modules/core/graphics.nix b/modules/core/graphics.nix new file mode 100644 index 0000000..daa2c47 --- /dev/null +++ b/modules/core/graphics.nix @@ -0,0 +1,21 @@ +{ config, lib, pkgs, ... }: + +let + inherit (lib) mkIf; + + cfg = config.pepe.core.graphics; +in +{ + options.pepe.core.graphics = with lib; { + enable = mkEnableOption "Enable graphics"; + nvidia = mkEnableOption "Enable nvidia graphics"; + }; + + config = mkIf cfg.enable { + hardware.opengl = { + enable = true; + extraPackages = with pkgs; mkIf cfg.nvidia [ vaapiVdpau ]; + }; + }; +} +