Fix nix wrapper usage with git locked inputs

Signed-off-by: magic_rb <richard@brezak.sk>
This commit is contained in:
magic_rb 2023-10-23 22:18:15 +02:00
parent c9db1e39b5
commit ac36a08bf2
No known key found for this signature in database
GPG key ID: 08D5287CC5DDCA0E

View file

@ -249,16 +249,26 @@
i="0" i="0"
flake=0 flake=0
immutable=0
for arg in "$@" ; do
if [[ "$arg" =~ "^git+file://.*$" ]] ; then
immutable=1
fi
done
for arg in "$@" ; do for arg in "$@" ; do
case "$arg" in case "$arg" in
build|eval) build|eval|run)
new_args[$i]="$arg" new_args[$i]="$arg"
new_args[$(($i + 1))]="--reference-lock-file" new_args[$(($i + 1))]="--reference-lock-file"
new_args[$(($i + 2))]="flake-secret.lock" new_args[$(($i + 2))]="flake-secret.lock"
new_args[$(($i + 3))]="--output-lock-file" if [[ "$immutable" != 0 ]] ; then
new_args[$(($i + 4))]="flake-secret.lock" new_args[$(($i + 3))]="--output-lock-file"
i="$(($i + 5))" new_args[$(($i + 4))]="flake-secret.lock"
i="$(($i + 2))"
fi
i="$(($i + 3))"
;; ;;
flake) flake)
new_args[$i]="$arg" new_args[$i]="$arg"