* 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:
parent
990b82ecd3
commit
6fc82e5697
8 changed files with 32 additions and 23 deletions
|
|
@ -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 ];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue