forked from Fediversity/Fediversity
Replace concatMapAttrs
+ filterAttrs
by concatMapAttrs
+ optionalAttrs
This commit is contained in:
parent
377ad0ea6e
commit
3f0cdaf0aa
|
@ -6,7 +6,7 @@
|
|||
|
||||
let
|
||||
inherit (builtins) elem;
|
||||
inherit (lib.attrsets) concatMapAttrs filterAttrs;
|
||||
inherit (lib.attrsets) concatMapAttrs optionalAttrs;
|
||||
inherit (lib.strings) removeSuffix;
|
||||
|
||||
secrets = import ./secrets.nix;
|
||||
|
@ -27,9 +27,12 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
config.age.secrets = concatMapAttrs (name: _: {
|
||||
${removeSuffix ".age" name}.file = ./. + "/${name}";
|
||||
}) (filterAttrs (_: secret: elem config.x_fediversity.hostPublicKey secret.publicKeys) secrets);
|
||||
config.age.secrets = concatMapAttrs (
|
||||
name: secret:
|
||||
optionalAttrs (elem config.x_fediversity.hostPublicKey secret.publicKeys) ({
|
||||
${removeSuffix ".age" name}.file = ./. + "/${name}";
|
||||
})
|
||||
) secrets;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue