sops: fix secret path generation
All checks were successful
checks / check-links (pull_request) Successful in 14s
checks / checks-impure (pull_request) Successful in 1m53s
checks / checks (pull_request) Successful in 3m46s

This commit is contained in:
Jörg Thalheim 2024-04-12 12:39:09 +02:00
parent 396071a925
commit 58446db110
2 changed files with 4 additions and 1 deletions

View File

@ -45,7 +45,9 @@ in
config = lib.mkIf (config.clanCore.facts.secretStore == "sops") {
# Before we generate a secret we cannot know the path yet, so we need to set it to an empty string
clanCore.facts.secretPathFunction =
secret: config.sops.secrets.${secret.config.name}.path or "/no-such-path";
secret:
config.sops.secrets.${"${config.clanCore.machineName}-${secret.config.name}"}.path
or "/no-such-path";
clanCore.facts.secretModule = "clan_cli.facts.secret_modules.sops";
clanCore.facts.secretUploadDirectory = lib.mkDefault "/var/lib/sops-nix";
sops.secrets = builtins.mapAttrs (name: _: {

View File

@ -36,6 +36,7 @@
};
machineName = lib.mkOption {
type = lib.types.str;
default = "nixos";
description = ''
the name of the machine
'';