Skip to content

Commit

Permalink
update-flake.sh: support 2.18.2
Browse files Browse the repository at this point in the history
2.18.2 is greater than 2.18 but does not support --flake.
  • Loading branch information
jonasnick committed May 24, 2024
1 parent 84b8b1f commit 2bb70e8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions helper/update-flake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ if [[ $forceRun ]] && ! git diff --quiet ../flake.{nix,lock}; then
exit 1
fi

# Support Nix >2.18
# Support Nix >=2.19
{
versionGreaterThan() {
[[ $1 != $(echo -e "$1\n$2" | sort -V | head -n1) ]]
versionGreaterThanOrEqual() {
[[ $1 != $(echo -e "$1\n$2" | sort -V | head -n1) || $1 == "$2" ]]
}
nixVersion=$(nix --version | cut -d\ -f 3)
if versionGreaterThan "$nixVersion" 2.18; then
if versionGreaterThanOrEqual "$nixVersion" 2.19; then
# https://nixos.org/manual/nix/stable/release-notes/rl-2.19#:~:text=nix%20flake%20update
nixUpdateArg=--flake
else
Expand Down

0 comments on commit 2bb70e8

Please sign in to comment.