secrets deploy/generate: use nix_build_machine
This commit is contained in:
@@ -4,25 +4,20 @@ import sys
|
||||
|
||||
from clan_cli.errors import ClanError
|
||||
|
||||
from ..dirs import get_clan_flake_toplevel
|
||||
from ..nix import nix_build_machine
|
||||
|
||||
|
||||
def generate_secrets(machine: str) -> None:
|
||||
clan_flake = get_clan_flake_toplevel()
|
||||
proc = subprocess.run(
|
||||
[
|
||||
"nix",
|
||||
"build",
|
||||
"--impure",
|
||||
"--print-out-paths",
|
||||
"--expr",
|
||||
f'let f = builtins.getFlake "{clan_flake}"; in '
|
||||
"(f.nixosConfigurations."
|
||||
f"{machine}"
|
||||
".extendModules { modules = [{ clanCore.clanDir = "
|
||||
f"{clan_flake}"
|
||||
"; }]; }).config.system.clan.generateSecrets",
|
||||
],
|
||||
nix_build_machine(
|
||||
machine=machine,
|
||||
attr=[
|
||||
"config",
|
||||
"system",
|
||||
"clan",
|
||||
"generateSecrets",
|
||||
],
|
||||
),
|
||||
capture_output=True,
|
||||
text=True,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user