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