secrets: register agenix secrets automatically
This commit is contained in:
parent
8664781da7
commit
98034a5410
|
@ -1,4 +1,4 @@
|
|||
{ inputs, lib, ... }:
|
||||
{ inputs, lib, options, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
|
@ -30,6 +30,25 @@ throwOnCanary {
|
|||
valueType;
|
||||
};
|
||||
|
||||
config.age = {
|
||||
secrets =
|
||||
let
|
||||
toName = removeSuffix ".age";
|
||||
toSecret = name: _: {
|
||||
file = ./. + "/${name}";
|
||||
owner = mkDefault "root";
|
||||
};
|
||||
convertSecrets = n: v: nameValuePair (toName n) (toSecret n v);
|
||||
secrets = import ./secrets.nix;
|
||||
in
|
||||
lib.mapAttrs' convertSecrets secrets;
|
||||
|
||||
sshKeyPaths = options.age.sshKeyPaths.default ++ [
|
||||
# FIXME: hard-coded path, could be inexistent
|
||||
"/home/ambroisie/.ssh/id_ed25519"
|
||||
];
|
||||
};
|
||||
|
||||
config.my.secrets = {
|
||||
acme.key = fileContents ./acme/key.env;
|
||||
|
||||
|
|
Loading…
Reference in a new issue