diff --git a/src/nixos_anywhere_pxe/__init__.py b/src/nixos_anywhere_pxe/__init__.py index cb7912ce..e9ff8b40 100644 --- a/src/nixos_anywhere_pxe/__init__.py +++ b/src/nixos_anywhere_pxe/__init__.py @@ -19,8 +19,13 @@ FILE = Union[None, int, IO] -NIXOS_ANYWHERE_SH = Path(__file__).parent.absolute() / "src/nixos-anywhere.sh" - +# use nixos-anywhere if available, else use unpackaged shell script for development +NIXOS_ANYWHERE_SH = shutil.which("nixos-anywhere") +if NIXOS_ANYWHERE_SH is not None: + # i prefer not having huge nix-store paths in the logs + NIXOS_ANYWHERE_SH = "nixos-anywhere" +else: + NIXOS_ANYWHERE_SH = Path(__file__).parent.absolute() / "src/nixos-anywhere.sh" def run( cmd: Union[str, list[str]],