diff --git a/system/modules/default.nix b/system/modules/default.nix index d6d751f..539d202 100644 --- a/system/modules/default.nix +++ b/system/modules/default.nix @@ -15,13 +15,12 @@ ./services ./audio ./meta + ./host + ./video ]; options.systemModules = { - security = { - enable = lib.mkEnableOption "Enable security module"; - }; pipewire = { enable = lib.mkEnableOption "Enable pipewire module"; }; diff --git a/system/modules/video/default.nix b/system/modules/video/default.nix new file mode 100644 index 0000000..3085717 --- /dev/null +++ b/system/modules/video/default.nix @@ -0,0 +1,21 @@ +{ lib, config, pkgs, ... }: + +let + inherit (lib) mkIf; + inherit (builtins) elem; + isx86Linux = pkgs: with pkgs.stdenv; hostPlatform.isLinux && hostPlatform.isx86; + host = config.systemModules.host; + validFunction = ["workstation" "gaming" "media-server"]; +in + +{ + config = mkIf (elem host.function validFunction) { + hardware = { + opengl = { + enable = true; + driSupport = true; + driSupport32Bit = isx86Linux pkgs; + }; + }; + }; +}