Merge pull request 'unpin nix-fast-build' (#341) from Mic92-docs into main
This commit is contained in:
@@ -134,19 +134,17 @@ def read_machine_option_value(
|
|||||||
clan_dir = get_clan_flake_toplevel()
|
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(
|
cmd = nix_eval(
|
||||||
nix_eval(
|
|
||||||
flags=[
|
flags=[
|
||||||
"--show-trace",
|
"--show-trace",
|
||||||
f"{clan_dir}#nixosConfigurations.{machine_name}.config.{option}",
|
f"{clan_dir}#nixosConfigurations.{machine_name}.config.{option}",
|
||||||
],
|
],
|
||||||
),
|
|
||||||
capture_output=True,
|
|
||||||
text=True,
|
|
||||||
)
|
)
|
||||||
|
proc = subprocess.run(cmd, stdout=subprocess.PIPE, text=True)
|
||||||
if proc.returncode != 0:
|
if proc.returncode != 0:
|
||||||
print(proc.stderr, file=sys.stderr)
|
raise ClanError(
|
||||||
raise ClanError(f"Failed to read option {option}:\n{proc.stderr}")
|
f"Failed to read option {option}:\n{shlex.join(cmd)}\nexit with {proc.returncode}"
|
||||||
|
)
|
||||||
value = json.loads(proc.stdout)
|
value = json.loads(proc.stdout)
|
||||||
# print the value so that the output can be copied and fed as an input.
|
# print the value so that the output can be copied and fed as an input.
|
||||||
# for example a list should be displayed as space separated values surrounded by quotes.
|
# for example a list should be displayed as space separated values surrounded by quotes.
|
||||||
|
|||||||
Reference in New Issue
Block a user