12 lines
334 B
Bash
12 lines
334 B
Bash
#!@bash@/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
target=".#lean"
|
|
args=(-- "$@")
|
|
# fall back to initial package if not in package
|
|
[[ ! -f flake.nix ]] && target="@srcRoot@"
|
|
# HACK: use stage 0 instead of 1 inside Lean's own `src/`
|
|
[[ -d Lean && -f ../flake.nix ]] && target="@srcTarget@" && args=@srcArgs@
|
|
|
|
@nix@/bin/nix run "$target" ${args[*]}
|