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 authored and Mic92 committed Jan 31, 2025
1 parent 6d6704c commit ebcd730
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 @@ -21,8 +21,13 @@

FILE = 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(
Expand Down

0 comments on commit ebcd730

Please sign in to comment.