From ce5726bbdd7623f396e584d8318ed335350c5131 Mon Sep 17 00:00:00 2001 From: magic_rb Date: Sat, 25 Nov 2023 18:00:40 +0100 Subject: [PATCH] Fix weird nix wrapper for secret stuff misdetection immutable commands Signed-off-by: magic_rb --- flake.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index ea6bd6b..9c09da6 100644 --- a/flake.nix +++ b/flake.nix @@ -262,7 +262,8 @@ immutable=0 for arg in "$@" ; do - if [[ "$arg" =~ "^git+file://.*$" ]] ; then + echo "$arg" + if [[ "$arg" =~ ^git\+file://.*$ ]] ; then immutable=1 fi done @@ -273,7 +274,7 @@ new_args[$i]="$arg" new_args[$(($i + 1))]="--reference-lock-file" new_args[$(($i + 2))]="flake-secret.lock" - if [[ "$immutable" != 0 ]] ; then + if [[ "$immutable" == 0 ]] ; then new_args[$(($i + 3))]="--output-lock-file" new_args[$(($i + 4))]="flake-secret.lock" i="$(($i + 2))" @@ -296,6 +297,7 @@ new_args[$(($i + 2))]="flake-secret.lock" new_args[$(($i + 3))]="--output-lock-file" new_args[$(($i + 4))]="flake-secret.lock" + flake=0 i="$(($i + 5))" else new_args[$i]="$arg"