mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 20:09:07 +01:00
sops: Rename secrets option to secretsData
This commit is contained in:
parent
3af7d23a46
commit
4887e06117
5 changed files with 10 additions and 10 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue