i3status-rust: revert #3938 (#3957)

* Revert "i3status-rust: satisfy new 0.31 TOML output requirements (#3938)"

This reverts commit 0e4c33d760.

* i3status-rust: assertion for unsupported versions
This commit is contained in:
amesgen 2023-05-07 13:42:55 +02:00 committed by GitHub
parent 990b82ecd3
commit 6fc82e5697
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 32 additions and 23 deletions

View file

@ -6,18 +6,7 @@ let
cfg = config.programs.i3status-rust;
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"
'';
};
settingsFormat = pkgs.formats.toml { };
in {
meta.maintainers = with lib.maintainers; [ farlion thiagokokada ];
@ -248,6 +237,12 @@ in {
assertions = [
(hm.assertions.assertPlatform "programs.i3status-rust" pkgs
platforms.linux)
{
assertion = lib.versionOlder cfg.package.version "0.31.0"
|| lib.versionAtLeast cfg.package.version "0.31.2";
message =
"Only i3status-rust <0.31.0 or 0.31.2 is supported due to a config format incompatibility.";
}
];
home.packages = [ cfg.package ];