mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 23:29:08 +01:00
sops: Add assertions to validate secret existence at eval time
This commit is contained in:
parent
dab77776f9
commit
87de9e1c4e
1 changed files with 8 additions and 0 deletions
|
|
@ -34,5 +34,13 @@ in
|
||||||
];
|
];
|
||||||
defaultSopsFile = cfg.secretsFile;
|
defaultSopsFile = cfg.secretsFile;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
assertions =
|
||||||
|
config.sops.secrets
|
||||||
|
|> lib.attrNames
|
||||||
|
|> lib.map (secretPath: {
|
||||||
|
assertion = cfg.secrets |> lib.hasAttrByPath (secretPath |> lib.splitString "/");
|
||||||
|
message = "Sops secret `${secretPath}` must be defined in secrets.json";
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue