1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-26 21:19:45 +01:00

i3status-rust: deprecate icons and theme options

Signed-off-by: Sumner Evans <me@sumnerevans.com>
This commit is contained in:
Sumner Evans 2023-06-05 23:03:31 -06:00
parent 28614ed7a1
commit 2790158226
No known key found for this signature in database
GPG key ID: 8904527AB50022FD

View file

@ -11,6 +11,23 @@ let
in { in {
meta.maintainers = with lib.maintainers; [ farlion thiagokokada ]; meta.maintainers = with lib.maintainers; [ farlion thiagokokada ];
imports = [
(mkRenamedOptionModule [
"programs"
"i3status-rust"
"bars"
"<name>"
"icons"
] [ "programs" "i3status-rust" "bars" "<name>" "settings" "icons" "icons" ])
(mkRenamedOptionModule [
"programs"
"i3status-rust"
"bars"
"<name>"
"theme"
] [ "programs" "i3status-rust" "bars" "<name>" "settings" "theme" "theme" ])
];
options.programs.i3status-rust = { options.programs.i3status-rust = {
enable = mkEnableOption "a replacement for i3-status written in Rust"; enable = mkEnableOption "a replacement for i3-status written in Rust";
@ -102,28 +119,6 @@ in {
} }
''; '';
}; };
icons = mkOption {
type = types.str;
default = "none";
description = ''
The icons set to use. See
<link xlink:href="https://github.com/greshake/i3status-rust/blob/master/doc/themes.md"/>
for a list of available icon sets.
'';
example = "awesome6";
};
theme = mkOption {
type = types.str;
default = "plain";
description = ''
The theme to use. See
<link xlink:href="https://github.com/greshake/i3status-rust/blob/master/doc/themes.md"/>
for a list of available themes.
'';
example = "gruvbox-dark";
};
}; };
}); });
@ -218,8 +213,6 @@ in {
}; };
}; };
}; };
icons = "awesome5";
theme = "gruvbox-dark";
}; };
''; '';
}; };
@ -248,7 +241,7 @@ in {
home.packages = [ cfg.package ]; home.packages = [ cfg.package ];
xdg.configFile = mapAttrs' (cfgFileSuffix: cfgBar: xdg.configFile = mapAttrs' (cfgFileSuffix: cfgBar:
nameValuePair ("i3status-rust/config-${cfgFileSuffix}.toml") ({ nameValuePair "i3status-rust/config-${cfgFileSuffix}.toml" ({
onChange = mkIf config.xsession.windowManager.i3.enable '' onChange = mkIf config.xsession.windowManager.i3.enable ''
i3Socket="''${XDG_RUNTIME_DIR:-/run/user/$UID}/i3/ipc-socket.*" i3Socket="''${XDG_RUNTIME_DIR:-/run/user/$UID}/i3/ipc-socket.*"
if [[ -S $i3Socket ]]; then if [[ -S $i3Socket ]]; then
@ -256,17 +249,8 @@ in {
fi fi
''; '';
source = settingsFormat.generate ("config-${cfgFileSuffix}.toml") ({ source = settingsFormat.generate "config-${cfgFileSuffix}.toml"
theme = if lib.versionAtLeast cfg.package.version "0.30.0" then { ({ block = cfgBar.blocks; } // cfgBar.settings);
theme = cfgBar.theme;
} else
cfgBar.theme;
icons = if lib.versionAtLeast cfg.package.version "0.30.0" then {
icons = cfgBar.icons;
} else
cfgBar.icons;
block = cfgBar.blocks;
} // cfgBar.settings);
})) cfg.bars; })) cfg.bars;
}; };
} }