Add sops-nix templates

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-02-26 13:52:03 +00:00
parent 93c13d8537
commit 3444645ec9
7 changed files with 89 additions and 32 deletions

View File

@@ -2,11 +2,29 @@
user ? throw "user argument is required",
home ? throw "home argument is required",
}:
{ lib, ... }:
{
home-manager.users.${user}.sops.secrets = {
"registry" = {
sopsFile = ../../../../../../../secrets/sas/secrets.yaml;
config,
lib,
pkgs,
...
}:
let
hmConfig = config.home-manager.users.${user};
in
{
home-manager.users.${user}.sops = {
secrets."registry/cr.sas.com".sopsFile = ../../../../../../../secrets/sas/secrets.yaml;
templates."containers-auth.json" = {
content = builtins.readFile (
(pkgs.formats.json { }).generate "auth.json" {
auths = {
"cr.sas.com" = {
auth = hmConfig.sops.placeholder."registry/cr.sas.com";
};
};
}
);
path = "${home}/.config/containers/auth.json";
};
};