Merge pull request 'rename lingering clan.vars -> clan.core.vars' (#4224) from rip_clan_vars into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4224
This commit is contained in:
@@ -46,7 +46,7 @@ in
|
||||
assertion = config.clan.core.vars.settings.passBackend == null;
|
||||
message = ''
|
||||
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.
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ in
|
||||
{
|
||||
_class = "nixos";
|
||||
|
||||
options.clan.vars.password-store = {
|
||||
options.clan.core.vars.password-store = {
|
||||
secretLocation = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
default = "/etc/secret-vars";
|
||||
@@ -83,7 +83,7 @@ in
|
||||
else if file.config.neededFor == "services" then
|
||||
"/run/secrets/${file.config.generatorName}/${file.config.name}"
|
||||
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
|
||||
"/run/partitioning-secrets/${file.config.generatorName}/${file.config.name}"
|
||||
else
|
||||
@@ -102,7 +102,7 @@ in
|
||||
]
|
||||
''
|
||||
[ -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) {
|
||||
supportsDryActivation = true;
|
||||
@@ -118,7 +118,7 @@ in
|
||||
]
|
||||
''
|
||||
[ -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) {
|
||||
supportsDryActivation = true;
|
||||
@@ -136,7 +136,7 @@ in
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
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;
|
||||
};
|
||||
@@ -149,7 +149,7 @@ in
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
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;
|
||||
};
|
||||
|
||||
@@ -45,11 +45,11 @@ class SecretStore(StoreBase):
|
||||
@property
|
||||
def _pass_command(self) -> str:
|
||||
out_path = self.machine.select(
|
||||
"config.clan.vars.password-store.passPackage.outPath"
|
||||
"config.clan.core.vars.password-store.passPackage.outPath"
|
||||
)
|
||||
main_program = (
|
||||
self.machine.select(
|
||||
"config.clan.vars.password-store.passPackage.?meta.?mainProgram"
|
||||
"config.clan.core.vars.password-store.passPackage.?meta.?mainProgram"
|
||||
)
|
||||
.get("meta", {})
|
||||
.get("mainProgram")
|
||||
@@ -158,7 +158,7 @@ class SecretStore(StoreBase):
|
||||
remote_hash = host.run(
|
||||
[
|
||||
"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),
|
||||
).stdout.strip()
|
||||
@@ -247,6 +247,8 @@ class SecretStore(StoreBase):
|
||||
pass_dir = Path(_tempdir).resolve()
|
||||
self.populate_dir(pass_dir, phases)
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user