sops: Rename secrets option to secretsData

This commit is contained in:
SebastianStork 2026-02-28 00:13:51 +01:00
parent 3af7d23a46
commit 4887e06117
Signed by: SebastianStork
SSH key fingerprint: SHA256:tRrGdjYOwgHxpSc/wTOZQZEjxcb15P0tyXRsbAfd+2Q
5 changed files with 10 additions and 10 deletions

View file

@ -25,7 +25,7 @@ in
type = self.lib.types.existingPath;
default = "${self}/users/${config.home.username}/@${osConfig.networking.hostName}/secrets.json";
};
secrets = lib.mkOption {
secretsData = lib.mkOption {
type = lib.types.anything;
default = cfg.secretsFile |> lib.readFile |> lib.strings.fromJSON;
};
@ -42,12 +42,12 @@ in
config.sops.secrets
|> lib.attrNames
|> lib.map (secretPath: {
assertion = cfg.secrets |> lib.hasAttrByPath (secretPath |> lib.splitString "/");
assertion = cfg.secretsData |> lib.hasAttrByPath (secretPath |> lib.splitString "/");
message = "Sops secret `${secretPath}` is used in a module but not defined in secrets.json";
})
)
++ (
lib.removeAttrs cfg.secrets [ "sops" ]
lib.removeAttrs cfg.secretsData [ "sops" ]
|> lib.mapAttrsToListRecursive (path: _: path |> lib.concatStringsSep "/")
|> lib.map (secretPath: {
assertion = config.sops.secrets |> lib.hasAttr secretPath;