tasks: add prefix for sops secrets key path

This commit is contained in:
Gabriel Arazas 2023-07-05 13:04:52 +08:00
parent 2677400a43
commit 240515ed3b
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
2 changed files with 16 additions and 13 deletions

View File

@ -44,16 +44,18 @@ in
lib.mkEnableOption "backup setup with BorgBackup";
config = lib.mkIf cfg.enable {
sops.secrets = lib.getSecrets (lib.getSecret "backup-archive.yaml") {
"borg-backup/patterns/home" = { };
"borg-backup/patterns/etc" = { };
"borg-backup/patterns/keys" = { };
"borg-backup/patterns/remote-backup" = { };
"borg-backup/repos/archive/password" = { };
"borg-backup/repos/external-drive/password" = { };
"borg-backup/repos/hetzner-box/password" = { };
"borg-backup/ssh-key" = { };
};
sops.secrets = lib.getSecrets
(lib.getSecret "backup-archive.yaml")
(lib.attachSopsPathPrefix "borg-backup" {
"patterns/home" = { };
"patterns/etc" = { };
"patterns/keys" = { };
"patterns/remote-backup" = { };
"repos/archive/password" = { };
"repos/external-drive/password" = { };
"repos/hetzner-box/password" = { };
"ssh-key" = { };
});
profiles.filesystem = {
archive.enable = true;

View File

@ -93,9 +93,10 @@ in
{
environment.systemPackages = [ ytdlpArchiveVariant ];
sops.secrets = lib.getSecrets (lib.getSecret "multimedia-archive.yaml") {
"multimedia-archive/secrets-config" = { };
};
sops.secrets = lib.getSecrets (lib.getSecret "multimedia-archive.yaml")
(lib.attachSopsPathPrefix "multimedia-archive" {
"secrets-config" = { };
});
profiles.filesystem.archive.enable = true;