feat: Added nix option

fix: nix options position

Use empty list


fix options
This commit is contained in:
xgroleau🐢 2023-03-28 16:38:02 -04:00 committed by Cole Helbling
parent bc75a5b55e
commit b55ee105d9
2 changed files with 14 additions and 2 deletions

View file

@ -5,12 +5,19 @@ if [[ -n "$PATH_TO_FLAKE_DIR" ]]; then
cd "$PATH_TO_FLAKE_DIR"
fi
options=()
if [[ -n "$NIX_OPTIONS" ]]; then
for option in $NIX_OPTIONS; do
options+=("${option}")
done
fi
if [[ -n "$TARGETS" ]]; then
inputs=()
for input in $TARGETS; do
inputs+=("--update-input" "$input")
done
nix flake lock "${inputs[@]}" --commit-lock-file --commit-lockfile-summary "$COMMIT_MSG"
nix "${options[@]}" flake lock "${inputs[@]}" --commit-lock-file --commit-lockfile-summary "$COMMIT_MSG"
else
nix flake update --commit-lock-file --commit-lockfile-summary "$COMMIT_MSG"
nix "${options[@]}" flake update --commit-lock-file --commit-lockfile-summary "$COMMIT_MSG"
fi