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:
parent
30ea6fed4e
commit
64e29e52d6
1 changed files with 11 additions and 9 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue