mirror of
https://gitlab.com/simple-nixos-mailserver/nixos-mailserver.git
synced 2024-11-11 19:39:16 +05:00
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
|
||
|
''
|