i3status-rust: satisfy new 0.31 TOML output requirements (#3938)
This commit is contained in:
parent
3144311f31
commit
0e4c33d760
|
@ -6,7 +6,18 @@ let
|
|||
|
||||
cfg = config.programs.i3status-rust;
|
||||
|
||||
settingsFormat = pkgs.formats.toml { };
|
||||
settingsFormat = pkgs.formats.toml { } // {
|
||||
# Since 0.31, the "block" key has to be first in the TOML output.
|
||||
generate = name: value:
|
||||
pkgs.runCommand name {
|
||||
nativeBuildInputs = [ pkgs.jq pkgs.remarshal ];
|
||||
value = builtins.toJSON value;
|
||||
passAsFile = [ "value" ];
|
||||
} ''
|
||||
jq '.block |= map({block: .block} + del(.block))' "$valuePath" \
|
||||
| json2toml --preserve-key-order > "$out"
|
||||
'';
|
||||
};
|
||||
|
||||
in {
|
||||
meta.maintainers = with lib.maintainers; [ farlion thiagokokada ];
|
||||
|
|
|
@ -105,12 +105,12 @@
|
|||
${
|
||||
pkgs.writeText "i3status-rust-expected-config" ''
|
||||
[[block]]
|
||||
alert = 10.0
|
||||
block = "disk_space"
|
||||
alert = 10
|
||||
info_type = "available"
|
||||
interval = 60
|
||||
path = "/"
|
||||
warning = 20.0
|
||||
warning = 20
|
||||
|
||||
[[block]]
|
||||
block = "memory"
|
||||
|
|
|
@ -12,12 +12,12 @@
|
|||
${
|
||||
pkgs.writeText "i3status-rust-expected-config" ''
|
||||
[[block]]
|
||||
alert = 10.0
|
||||
block = "disk_space"
|
||||
alert = 10
|
||||
info_type = "available"
|
||||
interval = 60
|
||||
path = "/"
|
||||
warning = 20.0
|
||||
warning = 20
|
||||
|
||||
[[block]]
|
||||
block = "memory"
|
||||
|
|
|
@ -115,12 +115,12 @@
|
|||
${
|
||||
pkgs.writeText "i3status-rust-expected-config" ''
|
||||
[[block]]
|
||||
alert = 10.0
|
||||
block = "disk_space"
|
||||
alert = 10
|
||||
info_type = "available"
|
||||
interval = 60
|
||||
path = "/"
|
||||
warning = 20.0
|
||||
warning = 20
|
||||
|
||||
[[block]]
|
||||
block = "memory"
|
||||
|
|
|
@ -54,11 +54,11 @@
|
|||
${
|
||||
pkgs.writeText "i3status-rust-expected-config" ''
|
||||
[[block]]
|
||||
alert = 10.0
|
||||
block = "disk_space"
|
||||
alert = 10
|
||||
info_type = "available"
|
||||
interval = 60
|
||||
warning = 20.0
|
||||
warning = 20
|
||||
|
||||
[[block]]
|
||||
block = "memory"
|
||||
|
|
|
@ -14,12 +14,12 @@
|
|||
icons = "none"
|
||||
theme = "plain"
|
||||
[[block]]
|
||||
alert = 10.0
|
||||
block = "disk_space"
|
||||
alert = 10
|
||||
info_type = "available"
|
||||
interval = 60
|
||||
path = "/"
|
||||
warning = 20.0
|
||||
warning = 20
|
||||
|
||||
[[block]]
|
||||
block = "memory"
|
||||
|
|
Loading…
Reference in a new issue