Skip to content

Commit

Permalink
nixos-anywhere-pxe: fix nixos-anywhere path
Browse files Browse the repository at this point in the history
works for development and with nix package
  • Loading branch information
pogobanane committed Sep 20, 2023
1 parent c5eecbc commit b8c94b5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/nixos_anywhere_pxe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]],
Expand Down

0 comments on commit b8c94b5

Please sign in to comment.