Merge pull request 'config: read nixos option correctly' (#324) from Mic92-docs into main
This commit is contained in:
@@ -118,15 +118,14 @@ def options_for_machine(machine_name: str) -> dict:
|
|||||||
|
|
||||||
|
|
||||||
def read_machine_option_value(machine_name: str, option: str) -> str:
|
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}
|
# use nix eval to read from .#nixosConfigurations.default.config.{option}
|
||||||
# this will give us the evaluated config with the options attribute
|
# this will give us the evaluated config with the options attribute
|
||||||
proc = subprocess.run(
|
proc = subprocess.run(
|
||||||
nix_eval(
|
nix_eval(
|
||||||
flags=[
|
flags=[
|
||||||
"--show-trace",
|
"--show-trace",
|
||||||
"--extra-experimental-features",
|
f"{clan_dir}#nixosConfigurations.{machine_name}.config.{option}",
|
||||||
"nix-command flakes",
|
|
||||||
f".#nixosConfigurations.{machine_name}.config.{option}",
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
|
|||||||
Reference in New Issue
Block a user