lean4-htt/nix/lean-dev.in
2021-01-19 19:06:01 +01:00

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[*]}