mirror of
https://gitlab.com/simple-nixos-mailserver/nixos-mailserver.git
synced 2024-12-28 07:56:12 +01:00
5b570ad5a0
This allows determining whether it's OK to use particular configuration variables that will throw errors when used in older versions.
12 lines
399 B
Nix
12 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
|
|
''
|