Add sops-nix templates
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -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";
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user