mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 22:29:06 +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
|
|
@ -33,7 +33,7 @@ in
|
|||
enable = lib.mkEnableOption "";
|
||||
networks = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.nonEmptyStr;
|
||||
default = config.custom.sops.secrets.iwd |> lib.attrNames;
|
||||
default = config.custom.sops.secretsData.iwd |> lib.attrNames;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ let
|
|||
|
||||
inherit (config.services.syncthing) dataDir;
|
||||
|
||||
useSopsSecrets = config.custom.sops.secrets |> lib.hasAttr "syncthing";
|
||||
useSopsSecrets = config.custom.sops.secretsData |> lib.hasAttr "syncthing";
|
||||
in
|
||||
{
|
||||
options.custom.services.syncthing = {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ in
|
|||
type = self.lib.types.existingPath;
|
||||
default = "${self}/hosts/${config.networking.hostName}/secrets.json";
|
||||
};
|
||||
secrets = lib.mkOption {
|
||||
secretsData = lib.mkOption {
|
||||
type = lib.types.anything;
|
||||
default = cfg.secretsFile |> lib.readFile |> lib.strings.fromJSON;
|
||||
};
|
||||
|
|
@ -40,12 +40,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