update-flake.sh: support 2.18.2
2.18.2 is greater than 2.18 but does not support --flake.
This commit is contained in:
parent
84b8b1ffe9
commit
2bb70e84be
1 changed files with 4 additions and 4 deletions
|
|
@ -39,13 +39,13 @@ if [[ $forceRun ]] && ! git diff --quiet ../flake.{nix,lock}; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Support Nix >2.18
|
# Support Nix >=2.19
|
||||||
{
|
{
|
||||||
versionGreaterThan() {
|
versionGreaterThanOrEqual() {
|
||||||
[[ $1 != $(echo -e "$1\n$2" | sort -V | head -n1) ]]
|
[[ $1 != $(echo -e "$1\n$2" | sort -V | head -n1) || $1 == "$2" ]]
|
||||||
}
|
}
|
||||||
nixVersion=$(nix --version | cut -d\ -f 3)
|
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
|
# https://nixos.org/manual/nix/stable/release-notes/rl-2.19#:~:text=nix%20flake%20update
|
||||||
nixUpdateArg=--flake
|
nixUpdateArg=--flake
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue