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