mirror of
https://gitlab.com/simple-nixos-mailserver/nixos-mailserver.git
synced 2024-11-14 21:08:34 +05:00
5b570ad5a0
This allows determining whether it's OK to use particular configuration variables that will throw errors when used in older versions.
13 lines
399 B
Nix
13 lines
399 B
Nix
{ dovecot, gawk, gnused, jq, runCommand }:
|
|
|
|
runCommand "dovecot-version" {
|
|
buildInputs = [dovecot gnused jq];
|
|
} ''
|
|
jq -n \
|
|
--arg dovecot_version "$(dovecot --version |
|
|
sed 's/\([0-9.]*\).*/\1/' |
|
|
awk -F '.' '{ print $1"."$2"."$3 }')" \
|
|
'[$dovecot_version | split("."), ["major", "minor", "patch"]]
|
|
| transpose | map( { (.[1]): .[0] | tonumber }) | add' > $out
|
|
''
|