From 1e0bf85b2f7bc141bf678ac025aa1319191327ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sat, 23 Sep 2023 11:30:58 +0200 Subject: [PATCH 1/2] unpin nix-fast-build --- .gitea/workflows/checks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/checks.yaml b/.gitea/workflows/checks.yaml index bd8b3be7d..432134298 100644 --- a/.gitea/workflows/checks.yaml +++ b/.gitea/workflows/checks.yaml @@ -9,4 +9,4 @@ jobs: runs-on: nix steps: - uses: actions/checkout@v3 - - run: nix run --refresh github:Mic92/nix-fast-build/ae50c356c2f9e790f3d9d8e00bfa9f4b54f49bdd + - run: nix run --refresh github:Mic92/nix-fast-build -- --no-nom From 29a48725efc68b04be925e5422e035acbe674ba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 26 Sep 2023 14:00:20 +0200 Subject: [PATCH 2/2] clan config: print command on error --- pkgs/clan-cli/clan_cli/config/__init__.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/pkgs/clan-cli/clan_cli/config/__init__.py b/pkgs/clan-cli/clan_cli/config/__init__.py index cc119a911..ed0557a4f 100644 --- a/pkgs/clan-cli/clan_cli/config/__init__.py +++ b/pkgs/clan-cli/clan_cli/config/__init__.py @@ -123,19 +123,17 @@ def read_machine_option_value( 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", - f"{clan_dir}#nixosConfigurations.{machine_name}.config.{option}", - ], - ), - capture_output=True, - text=True, + cmd = nix_eval( + flags=[ + "--show-trace", + f"{clan_dir}#nixosConfigurations.{machine_name}.config.{option}", + ], ) + proc = subprocess.run(cmd, stdout=subprocess.PIPE, text=True) if proc.returncode != 0: - print(proc.stderr, file=sys.stderr) - raise ClanError(f"Failed to read option {option}:\n{proc.stderr}") + raise ClanError( + f"Failed to read option {option}:\n{shlex.join(cmd)}\nexit with {proc.returncode}" + ) value = json.loads(proc.stdout) # 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.