mirror of
https://github.com/nix-community/nixos-anywhere.git
synced 2024-08-17 12:20:47 +03:00
nixos-anywhere-pxe: fix nixos-anywhere path
works for development and with nix package
This commit is contained in:
parent
0e0558231a
commit
f214975b4f
@ -18,10 +18,15 @@ from typing import IO, Iterator, List, NoReturn, Optional, Tuple, Union
|
|||||||
|
|
||||||
FILE = Union[None, int, IO]
|
FILE = Union[None, int, IO]
|
||||||
|
|
||||||
|
# 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"
|
NIXOS_ANYWHERE_SH = Path(__file__).parent.absolute() / "src/nixos-anywhere.sh"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def run(
|
def run(
|
||||||
cmd: Union[str, list[str]],
|
cmd: Union[str, list[str]],
|
||||||
input: Optional[str] = None,
|
input: Optional[str] = None,
|
||||||
|
Loading…
Reference in New Issue
Block a user