::: {.warning}
To be able to access the relative path of the `.cred` file,
- `inputs.self` has to be used in `LoadCredentialEncrypted`.
+ `inputs.self` has to be used in `LoadCredentialEncrypted=`.
Note that `inputs` is a `config._module.args` or `specialArgs`
usually set in your `flake.nix`.
- Using `''${wireguard/wg-intra/privatekey}`
+ In other words, using `''${wireguard/wg-intra/privatekey}` here,
would not work, because it drops the `wireguard/wg-intra/` part.
:::
'';
credPath=${escapeShellArg credPath}
credBase=''${credPath#${builtins.storeDir}/*/}
if test "''${SYSTEMD_CREDS_FORCE_REENCRYPT:+set}" \
- -o ! -s "$credBase"; then
+ -o ! -s "$credBase" \
+ -o -e "''${credBase%.cred}.gpg" -a "$credBase" -ot "''${credBase%.cred}.gpg"; then
{ ${cfg.decrypt}; } |
{ ${cfg.shell} -- ${cfg.encrypt} - -; } |
{ ${cfg.install}; }