fn.sopsHelper option argument can now be a function or a set.

This commit is contained in:
Kevin Baensch 2023-09-11 19:29:31 +02:00
parent ec93123f4d
commit 9878b40111
Signed by: derped
GPG key ID: C0F1D326C7626543

9
fn.nix
View file

@ -58,8 +58,13 @@ rec {
(p: true) (deps p) (p: true) (deps p)
); );
sopsHelper = template: names: options: let sopsHelper = template: names: options: let
nameList = map template names; optionsIsFunction = (typeOf options) == "lambda";
in listToAttrs (map (nameEntry: {name = nameEntry; value = options;}) nameList); in listToAttrs (map
(name: {
name = template name;
value = ifelse optionsIsFunction (options name) options;
})
names);
pkgFilter = ld: (filter pkgFilter = ld: (filter
(p: ( (p: (
ifelse (isBroken p) ifelse (isBroken p)