modules/programs.nix: fix eval error when a program is suggestedBy multiple enabled packages
This commit is contained in:
parent
8cb236b0a9
commit
ec3a7067b6
|
@ -52,11 +52,17 @@ let
|
||||||
};
|
};
|
||||||
enableFor.user = mkOption {
|
enableFor.user = mkOption {
|
||||||
type = types.attrsOf types.bool;
|
type = types.attrsOf types.bool;
|
||||||
default = joinAttrsets (mapAttrsToList (otherName: otherPkg:
|
default =
|
||||||
optionalAttrs
|
let
|
||||||
(otherName != name && elem name otherPkg.suggestedPrograms && otherPkg.enableSuggested)
|
suggestedBy = mapAttrsToList (otherName: otherPkg:
|
||||||
(filterAttrs (user: en: en) otherPkg.enableFor.user)
|
optionalAttrs
|
||||||
) cfg);
|
(otherName != name && elem name otherPkg.suggestedPrograms && otherPkg.enableSuggested)
|
||||||
|
(filterAttrs (user: en: en) otherPkg.enableFor.user)
|
||||||
|
) cfg;
|
||||||
|
in
|
||||||
|
# we can just // the attrs since each set is flat and the only value
|
||||||
|
# each attr can have here is `true`, never `false`
|
||||||
|
lib.foldl' (prev: next: prev // next) {} suggestedBy;
|
||||||
description = ''
|
description = ''
|
||||||
place this program on the PATH for some specified user(s).
|
place this program on the PATH for some specified user(s).
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user