mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
i3status-rust: satisfy new 0.31 TOML output requirements (#3938)
This commit is contained in:
parent
3144311f31
commit
0e4c33d760
6 changed files with 22 additions and 11 deletions
|
@ -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