From 9878b401117ef9e253840fecdf874fd2ae56f220 Mon Sep 17 00:00:00 2001 From: derped Date: Mon, 11 Sep 2023 19:29:31 +0200 Subject: [PATCH] fn.sopsHelper option argument can now be a function or a set. --- fn.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fn.nix b/fn.nix index 3ea5a36..13e201b 100644 --- a/fn.nix +++ b/fn.nix @@ -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)