rename lingering clan.vars -> clan.core.vars

This commit is contained in:
lassulus
2025-07-07 00:46:06 +02:00
parent 5436f284fb
commit ca69864a20
3 changed files with 13 additions and 11 deletions

View File

@@ -46,7 +46,7 @@ in
assertion = config.clan.core.vars.settings.passBackend == null; assertion = config.clan.core.vars.settings.passBackend == null;
message = '' message = ''
The option `clan.core.vars.settings.passBackend' has been removed. The option `clan.core.vars.settings.passBackend' has been removed.
Use clan.vars.password-store.passPackage instead. Use clan.core.vars.password-store.passPackage instead.
Set it to pkgs.pass for GPG or pkgs.passage for age encryption. Set it to pkgs.pass for GPG or pkgs.passage for age encryption.
''; '';
} }

View File

@@ -54,7 +54,7 @@ in
{ {
_class = "nixos"; _class = "nixos";
options.clan.vars.password-store = { options.clan.core.vars.password-store = {
secretLocation = lib.mkOption { secretLocation = lib.mkOption {
type = lib.types.path; type = lib.types.path;
default = "/etc/secret-vars"; default = "/etc/secret-vars";
@@ -83,7 +83,7 @@ in
else if file.config.neededFor == "services" then else if file.config.neededFor == "services" then
"/run/secrets/${file.config.generatorName}/${file.config.name}" "/run/secrets/${file.config.generatorName}/${file.config.name}"
else if file.config.neededFor == "activation" then else if file.config.neededFor == "activation" then
"${config.clan.vars.password-store.secretLocation}/activation/${file.config.generatorName}/${file.config.name}" "${config.clan.core.vars.password-store.secretLocation}/activation/${file.config.generatorName}/${file.config.name}"
else if file.config.neededFor == "partitioning" then else if file.config.neededFor == "partitioning" then
"/run/partitioning-secrets/${file.config.generatorName}/${file.config.name}" "/run/partitioning-secrets/${file.config.generatorName}/${file.config.name}"
else else
@@ -102,7 +102,7 @@ in
] ]
'' ''
[ -e /run/current-system ] || echo setting up secrets... [ -e /run/current-system ] || echo setting up secrets...
${installSecretTarball}/bin/install-secret-tarball ${config.clan.vars.password-store.secretLocation}/secrets_for_users.tar.gz /run/user-secrets ${installSecretTarball}/bin/install-secret-tarball ${config.clan.core.vars.password-store.secretLocation}/secrets_for_users.tar.gz /run/user-secrets
'' ''
// lib.optionalAttrs (config.system ? dryActivationScript) { // lib.optionalAttrs (config.system ? dryActivationScript) {
supportsDryActivation = true; supportsDryActivation = true;
@@ -118,7 +118,7 @@ in
] ]
'' ''
[ -e /run/current-system ] || echo setting up secrets... [ -e /run/current-system ] || echo setting up secrets...
${installSecretTarball}/bin/install-secret-tarball ${config.clan.vars.password-store.secretLocation}/secrets.tar.gz /run/secrets ${installSecretTarball}/bin/install-secret-tarball ${config.clan.core.vars.password-store.secretLocation}/secrets.tar.gz /run/secrets
'' ''
// lib.optionalAttrs (config.system ? dryActivationScript) { // lib.optionalAttrs (config.system ? dryActivationScript) {
supportsDryActivation = true; supportsDryActivation = true;
@@ -136,7 +136,7 @@ in
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
ExecStart = [ ExecStart = [
"${installSecretTarball}/bin/install-secret-tarball ${config.clan.vars.password-store.secretLocation}/secrets_for_users.tar.gz /run/user-secrets" "${installSecretTarball}/bin/install-secret-tarball ${config.clan.core.vars.password-store.secretLocation}/secrets_for_users.tar.gz /run/user-secrets"
]; ];
RemainAfterExit = true; RemainAfterExit = true;
}; };
@@ -149,7 +149,7 @@ in
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
ExecStart = [ ExecStart = [
"${installSecretTarball}/bin/install-secret-tarball ${config.clan.vars.password-store.secretLocation}/secrets.tar.gz /run/secrets" "${installSecretTarball}/bin/install-secret-tarball ${config.clan.core.vars.password-store.secretLocation}/secrets.tar.gz /run/secrets"
]; ];
RemainAfterExit = true; RemainAfterExit = true;
}; };

View File

@@ -45,11 +45,11 @@ class SecretStore(StoreBase):
@property @property
def _pass_command(self) -> str: def _pass_command(self) -> str:
out_path = self.machine.select( out_path = self.machine.select(
"config.clan.vars.password-store.passPackage.outPath" "config.clan.core.vars.password-store.passPackage.outPath"
) )
main_program = ( main_program = (
self.machine.select( self.machine.select(
"config.clan.vars.password-store.passPackage.?meta.?mainProgram" "config.clan.core.vars.password-store.passPackage.?meta.?mainProgram"
) )
.get("meta", {}) .get("meta", {})
.get("mainProgram") .get("mainProgram")
@@ -158,7 +158,7 @@ class SecretStore(StoreBase):
remote_hash = host.run( remote_hash = host.run(
[ [
"cat", "cat",
f"{self.machine.select('config.clan.vars.password-store.secretLocation')}/.pass_info", f"{self.machine.select('config.clan.core.vars.password-store.secretLocation')}/.pass_info",
], ],
RunOpts(log=Log.STDERR, check=False), RunOpts(log=Log.STDERR, check=False),
).stdout.strip() ).stdout.strip()
@@ -247,6 +247,8 @@ class SecretStore(StoreBase):
pass_dir = Path(_tempdir).resolve() pass_dir = Path(_tempdir).resolve()
self.populate_dir(pass_dir, phases) self.populate_dir(pass_dir, phases)
upload_dir = Path( upload_dir = Path(
self.machine.select("config.clan.vars.password-store.secretLocation") self.machine.select(
"config.clan.core.vars.password-store.secretLocation"
)
) )
upload(host, pass_dir, upload_dir) upload(host, pass_dir, upload_dir)