mirror of
https://github.com/nix-community/comma.git
synced 2024-08-15 23:10:21 +03:00
add nix version 2.4 compatibility
Signed-off-by: Andreas Schmid <service@aaschmid.de>
This commit is contained in:
parent
4a62ec17e2
commit
f6f259214b
12
,
12
,
@ -40,5 +40,15 @@ fi
|
||||
if [[ -n $install ]]; then
|
||||
nix-env -iA "nixpkgs.${attr%%.*}"
|
||||
else
|
||||
nix run "nixpkgs.${attr}" -c "${argv0}" "$@"
|
||||
nix_version_greater_or_equal() {
|
||||
local nix_version
|
||||
nix_version=$(nix --version | cut -f3 -d ' ')
|
||||
printf '%s\n%s' "$1" "$nix_version" | sort -C -V
|
||||
}
|
||||
|
||||
if nix_version_greater_or_equal "2.4"; then
|
||||
nix --extra-experimental-features 'nix-command flakes' shell "nixpkgs#${attr}" -c "${argv0}" "$@"
|
||||
else
|
||||
nix run "nixpkgs.${attr}" -c "${argv0}" "$@"
|
||||
fi
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user