mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +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;
|
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 {
|
in {
|
||||||
meta.maintainers = with lib.maintainers; [ farlion thiagokokada ];
|
meta.maintainers = with lib.maintainers; [ farlion thiagokokada ];
|
||||||
|
|
|
@ -105,12 +105,12 @@
|
||||||
${
|
${
|
||||||
pkgs.writeText "i3status-rust-expected-config" ''
|
pkgs.writeText "i3status-rust-expected-config" ''
|
||||||
[[block]]
|
[[block]]
|
||||||
alert = 10.0
|
|
||||||
block = "disk_space"
|
block = "disk_space"
|
||||||
|
alert = 10
|
||||||
info_type = "available"
|
info_type = "available"
|
||||||
interval = 60
|
interval = 60
|
||||||
path = "/"
|
path = "/"
|
||||||
warning = 20.0
|
warning = 20
|
||||||
|
|
||||||
[[block]]
|
[[block]]
|
||||||
block = "memory"
|
block = "memory"
|
||||||
|
|
|
@ -12,12 +12,12 @@
|
||||||
${
|
${
|
||||||
pkgs.writeText "i3status-rust-expected-config" ''
|
pkgs.writeText "i3status-rust-expected-config" ''
|
||||||
[[block]]
|
[[block]]
|
||||||
alert = 10.0
|
|
||||||
block = "disk_space"
|
block = "disk_space"
|
||||||
|
alert = 10
|
||||||
info_type = "available"
|
info_type = "available"
|
||||||
interval = 60
|
interval = 60
|
||||||
path = "/"
|
path = "/"
|
||||||
warning = 20.0
|
warning = 20
|
||||||
|
|
||||||
[[block]]
|
[[block]]
|
||||||
block = "memory"
|
block = "memory"
|
||||||
|
|
|
@ -115,12 +115,12 @@
|
||||||
${
|
${
|
||||||
pkgs.writeText "i3status-rust-expected-config" ''
|
pkgs.writeText "i3status-rust-expected-config" ''
|
||||||
[[block]]
|
[[block]]
|
||||||
alert = 10.0
|
|
||||||
block = "disk_space"
|
block = "disk_space"
|
||||||
|
alert = 10
|
||||||
info_type = "available"
|
info_type = "available"
|
||||||
interval = 60
|
interval = 60
|
||||||
path = "/"
|
path = "/"
|
||||||
warning = 20.0
|
warning = 20
|
||||||
|
|
||||||
[[block]]
|
[[block]]
|
||||||
block = "memory"
|
block = "memory"
|
||||||
|
|
|
@ -54,11 +54,11 @@
|
||||||
${
|
${
|
||||||
pkgs.writeText "i3status-rust-expected-config" ''
|
pkgs.writeText "i3status-rust-expected-config" ''
|
||||||
[[block]]
|
[[block]]
|
||||||
alert = 10.0
|
|
||||||
block = "disk_space"
|
block = "disk_space"
|
||||||
|
alert = 10
|
||||||
info_type = "available"
|
info_type = "available"
|
||||||
interval = 60
|
interval = 60
|
||||||
warning = 20.0
|
warning = 20
|
||||||
|
|
||||||
[[block]]
|
[[block]]
|
||||||
block = "memory"
|
block = "memory"
|
||||||
|
|
|
@ -14,12 +14,12 @@
|
||||||
icons = "none"
|
icons = "none"
|
||||||
theme = "plain"
|
theme = "plain"
|
||||||
[[block]]
|
[[block]]
|
||||||
alert = 10.0
|
|
||||||
block = "disk_space"
|
block = "disk_space"
|
||||||
|
alert = 10
|
||||||
info_type = "available"
|
info_type = "available"
|
||||||
interval = 60
|
interval = 60
|
||||||
path = "/"
|
path = "/"
|
||||||
warning = 20.0
|
warning = 20
|
||||||
|
|
||||||
[[block]]
|
[[block]]
|
||||||
block = "memory"
|
block = "memory"
|
||||||
|
|
Loading…
Reference in a new issue