nix_eval: add --json by default
This commit is contained in:
@@ -100,7 +100,6 @@ def options_for_machine(machine_name: str, flake: Optional[Path] = None) -> dict
|
|||||||
proc = subprocess.run(
|
proc = subprocess.run(
|
||||||
nix_eval(
|
nix_eval(
|
||||||
flags=[
|
flags=[
|
||||||
"--json",
|
|
||||||
"--show-trace",
|
"--show-trace",
|
||||||
"--impure",
|
"--impure",
|
||||||
"--expr",
|
"--expr",
|
||||||
@@ -138,7 +137,6 @@ def read_machine_option_value(machine_name: str, option: str) -> str:
|
|||||||
proc = subprocess.run(
|
proc = subprocess.run(
|
||||||
nix_eval(
|
nix_eval(
|
||||||
flags=[
|
flags=[
|
||||||
"--json",
|
|
||||||
"--show-trace",
|
"--show-trace",
|
||||||
"--extra-experimental-features",
|
"--extra-experimental-features",
|
||||||
"nix-command flakes",
|
"nix-command flakes",
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ def schema_for_machine(machine_name: str, flake: Optional[Path] = None) -> dict:
|
|||||||
proc = subprocess.run(
|
proc = subprocess.run(
|
||||||
nix_eval(
|
nix_eval(
|
||||||
flags=[
|
flags=[
|
||||||
"--json",
|
|
||||||
"--impure",
|
"--impure",
|
||||||
"--show-trace",
|
"--show-trace",
|
||||||
"--extra-experimental-features",
|
"--extra-experimental-features",
|
||||||
|
|||||||
@@ -41,14 +41,19 @@ def nix_build_machine(
|
|||||||
|
|
||||||
|
|
||||||
def nix_eval(flags: list[str]) -> list[str]:
|
def nix_eval(flags: list[str]) -> list[str]:
|
||||||
if os.environ.get("IN_NIX_SANDBOX"):
|
default_flags = [
|
||||||
with tempfile.TemporaryDirectory() as nix_store:
|
|
||||||
return [
|
|
||||||
"nix",
|
"nix",
|
||||||
"eval",
|
"eval",
|
||||||
"--show-trace",
|
"--show-trace",
|
||||||
|
"--json",
|
||||||
"--extra-experimental-features",
|
"--extra-experimental-features",
|
||||||
"nix-command flakes",
|
"nix-command flakes",
|
||||||
|
]
|
||||||
|
if os.environ.get("IN_NIX_SANDBOX"):
|
||||||
|
with tempfile.TemporaryDirectory() as nix_store:
|
||||||
|
return (
|
||||||
|
default_flags
|
||||||
|
+ [
|
||||||
"--override-input",
|
"--override-input",
|
||||||
"nixpkgs",
|
"nixpkgs",
|
||||||
str(nixpkgs_source()),
|
str(nixpkgs_source()),
|
||||||
@@ -56,14 +61,10 @@ def nix_eval(flags: list[str]) -> list[str]:
|
|||||||
# error: cannot unlink '/nix/store/6xg259477c90a229xwmb53pdfkn6ig3g-default-builder.sh': Operation not permitted
|
# error: cannot unlink '/nix/store/6xg259477c90a229xwmb53pdfkn6ig3g-default-builder.sh': Operation not permitted
|
||||||
"--store",
|
"--store",
|
||||||
nix_store,
|
nix_store,
|
||||||
] + flags
|
]
|
||||||
return [
|
+ flags
|
||||||
"nix",
|
)
|
||||||
"eval",
|
return default_flags + flags
|
||||||
"--show-trace",
|
|
||||||
"--extra-experimental-features",
|
|
||||||
"nix-command flakes",
|
|
||||||
] + flags
|
|
||||||
|
|
||||||
|
|
||||||
def nix_shell(packages: list[str], cmd: list[str]) -> list[str]:
|
def nix_shell(packages: list[str], cmd: list[str]) -> list[str]:
|
||||||
|
|||||||
Reference in New Issue
Block a user