Skip to content

Commit

Permalink
Update secrets paths
Browse files Browse the repository at this point in the history
  • Loading branch information
rake5k committed Oct 6, 2024
1 parent c144f7e commit fc93d3a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
10 changes: 9 additions & 1 deletion home/roles/homeage/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,17 @@ in
description = "Secrets to install.";
};

secretsBasePath = mkOption {
type = types.str;
default = "${inputs.self}/secrets/home";
description = ''
Base path to the homeage secrets.
'';
};

secretsSourcePath = mkOption {
type = types.path;
default = "${inputs.self}/secrets/${config.home.username}";
default = "${cfg.secretsBasePath}/${config.home.username}";
description = "Default source path of the encrypted files.";
};

Expand Down
24 changes: 17 additions & 7 deletions nixos/base/agenix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,30 @@ in
imports = [ inputs.agenix.nixosModules.age ];

options = {
custom.base.agenix.secrets = mkOption {
type = with types; listOf str;
default = [ ];
description = ''
Secrets to install.
'';
custom.base.agenix = {
secretsBasePath = mkOption {
type = types.str;
default = "${inputs.self}/secrets/nixos";
description = ''
Base path to the system secrets.
'';
};

secrets = mkOption {
type = with types; listOf str;
default = [ ];
description = ''
Secrets to install.
'';
};
};
};

config = {
age = {
secrets = mkMerge (builtins.map
(secret: {
"${secret}".file = "${inputs.self}/secrets/${secret}.age";
"${secret}".file = "${cfg.secretsBasePath}/${secret}.age";
})
cfg.secrets);

Expand Down

0 comments on commit fc93d3a

Please sign in to comment.