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)
);
sopsHelper = template: names: options: let
nameList = map template names;
in listToAttrs (map (nameEntry: {name = nameEntry; value = options;}) nameList);
optionsIsFunction = (typeOf options) == "lambda";
in listToAttrs (map
(name: {
name = template name;
value = ifelse optionsIsFunction (options name) options;
})
names);
pkgFilter = ld: (filter
(p: (
ifelse (isBroken p)