From 46f746d09cdd06d5e47d3780162210906eed2bc4 Mon Sep 17 00:00:00 2001 From: Michael Hoang Date: Mon, 13 Oct 2025 14:39:52 +0200 Subject: [PATCH] cli: fix installation test with latest release of `nixos-anywhere` --- pkgs/clan-cli/clan_lib/machines/hardware.py | 7 +++++++ pkgs/clan-cli/clan_lib/machines/install.py | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/pkgs/clan-cli/clan_lib/machines/hardware.py b/pkgs/clan-cli/clan_lib/machines/hardware.py index 089627438..889c84bdf 100644 --- a/pkgs/clan-cli/clan_lib/machines/hardware.py +++ b/pkgs/clan-cli/clan_lib/machines/hardware.py @@ -119,6 +119,13 @@ def run_machine_hardware_info_init( if opts.debug: cmd += ["--debug"] + # REMOVEME when nixos-anywhere > 1.12.0 + # In 1.12.0 and earlier, nixos-anywhere doesn't pass Nix options when attempting to get substituters + # which leads to the installation test failing with the error of not being able to substitute flake-parts + # see: https://github.com/nix-community/nixos-anywhere/pull/596 + if "CLAN_TEST_STORE" in environ: + cmd += ["--no-use-machine-substituters"] + # Add nix options to nixos-anywhere cmd.extend(opts.machine.flake.nix_options or []) diff --git a/pkgs/clan-cli/clan_lib/machines/install.py b/pkgs/clan-cli/clan_lib/machines/install.py index 925a83ee4..c40befa2a 100644 --- a/pkgs/clan-cli/clan_lib/machines/install.py +++ b/pkgs/clan-cli/clan_lib/machines/install.py @@ -191,6 +191,13 @@ def run_machine_install(opts: InstallOptions, target_host: Remote) -> None: if opts.debug: cmd.append("--debug") + # REMOVEME when nixos-anywhere > 1.12.0 + # In 1.12.0 and earlier, nixos-anywhere doesn't pass Nix options when attempting to get substituters + # which leads to the installation test failing with the error of not being able to substitute flake-parts + # see: https://github.com/nix-community/nixos-anywhere/pull/596 + if "CLAN_TEST_STORE" in environ: + cmd += ["--no-use-machine-substituters"] + # Add nix options to nixos-anywhere cmd.extend(opts.machine.flake.nix_options or [])