1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-04-18 10:16:54 +00:00

nixgl: remove dependency between docs and config

This commit is contained in:
Robert Helgesson 2025-02-05 22:21:38 +01:00
parent 30ea6fed4e
commit 64e29e52d6
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED

View file

@ -2,11 +2,12 @@
let
cfg = config.nixGL;
wrapperListMarkdown = with builtins;
foldl' (list: name:
list + ''
- ${name}
'') "" (attrNames config.lib.nixGL.wrappers);
wrapperAttrNames = [ "mesa" "mesaPrime" "nvidia" "nvidiaPrime" ];
wrapperListMarkdown =
lib.concatMapStringsSep "\n" (v: "- ${v}") wrapperAttrNames;
in {
meta.maintainers = [ lib.maintainers.smona ];
@ -32,7 +33,7 @@ in {
};
defaultWrapper = lib.mkOption {
type = lib.types.enum (builtins.attrNames config.lib.nixGL.wrappers);
type = lib.types.enum wrapperAttrNames;
default = "mesa";
description = ''
The package wrapper function available for use as `(config.lib.nixGL.wrap
@ -48,7 +49,7 @@ in {
};
offloadWrapper = lib.mkOption {
type = lib.types.enum (builtins.attrNames config.lib.nixGL.wrappers);
type = lib.types.enum wrapperAttrNames;
default = "mesaPrime";
description = ''
The package wrapper function available for use as
@ -109,8 +110,7 @@ in {
};
installScripts = lib.mkOption {
type = with lib.types;
nullOr (listOf (enum (builtins.attrNames config.lib.nixGL.wrappers)));
type = with lib.types; nullOr (listOf (enum wrapperAttrNames));
default = null;
example = [ "mesa" "mesaPrime" ];
description = ''
@ -250,6 +250,8 @@ in {
makePackageWrapper vendor environment (pkg.override args);
};
# Note, if you add/remove/alter attribute names here you need to make a
# corresponding change in the definition of `wrapperAttrNames`.
wrappers = {
mesa = makePackageWrapper "Intel" { };
mesaPrime = makePackageWrapper "Intel" mesaOffloadEnv;