diff --git a/home/roles/homeage/default.nix b/home/roles/homeage/default.nix index ab0bbfd1..8a6f9972 100644 --- a/home/roles/homeage/default.nix +++ b/home/roles/homeage/default.nix @@ -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."; }; diff --git a/nixos/base/agenix/default.nix b/nixos/base/agenix/default.nix index 95755d35..2d84518d 100644 --- a/nixos/base/agenix/default.nix +++ b/nixos/base/agenix/default.nix @@ -12,12 +12,22 @@ 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. + ''; + }; }; }; @@ -25,7 +35,7 @@ in age = { secrets = mkMerge (builtins.map (secret: { - "${secret}".file = "${inputs.self}/secrets/${secret}.age"; + "${secret}".file = "${cfg.secretsBasePath}/${secret}.age"; }) cfg.secrets);