config: read nixos option correctly
All checks were successful
checks-impure / test (pull_request) Successful in 9s
checks / test (pull_request) Successful in 20s

This commit is contained in:
Jörg Thalheim 2023-09-22 14:38:23 +02:00
parent 51e8da2a74
commit 660dafd412

View File

@ -118,15 +118,14 @@ def options_for_machine(machine_name: str) -> dict:
def read_machine_option_value(machine_name: str, option: str) -> str:
clan_dir = get_clan_flake_toplevel()
# use nix eval to read from .#nixosConfigurations.default.config.{option}
# this will give us the evaluated config with the options attribute
proc = subprocess.run(
nix_eval(
flags=[
"--show-trace",
"--extra-experimental-features",
"nix-command flakes",
f".#nixosConfigurations.{machine_name}.config.{option}",
f"{clan_dir}#nixosConfigurations.{machine_name}.config.{option}",
],
),
capture_output=True,