nixos/dwm-status: use structured RFC0042-style settings
This commit is contained in:
parent
81d115dfbb
commit
07abe18272
@ -44,6 +44,8 @@
|
|||||||
|
|
||||||
- The `services.siproxd` module has been removed as `siproxd` is unmaintained and broken with libosip 5.x.
|
- The `services.siproxd` module has been removed as `siproxd` is unmaintained and broken with libosip 5.x.
|
||||||
|
|
||||||
|
- `services.dwm-status.extraConfig` was replaced by [RFC0042](https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md)-compliant [](#opt-services.dwm-status.settings), which is used to generate the config file. `services.dwm-status.order` is now moved to [](#opt-services.dwm-status.settings.order), as it's a part of the config file.
|
||||||
|
|
||||||
- `renovate` was updated to v40. See the [upstream release notes](https://github.com/renovatebot/renovate/releases/tag/40.0.0) for breaking changes.
|
- `renovate` was updated to v40. See the [upstream release notes](https://github.com/renovatebot/renovate/releases/tag/40.0.0) for breaking changes.
|
||||||
|
|
||||||
## Other Notable Changes {#sec-release-25.11-notable-changes}
|
## Other Notable Changes {#sec-release-25.11-notable-changes}
|
||||||
|
@ -7,16 +7,23 @@
|
|||||||
let
|
let
|
||||||
cfg = config.services.dwm-status;
|
cfg = config.services.dwm-status;
|
||||||
|
|
||||||
order = lib.concatMapStringsSep "," (feature: ''"${feature}"'') cfg.order;
|
format = pkgs.formats.toml { };
|
||||||
|
|
||||||
configFile = pkgs.writeText "dwm-status.toml" ''
|
configFile = format.generate "dwm-status.toml" cfg.settings;
|
||||||
order = [${order}]
|
|
||||||
|
|
||||||
${cfg.extraConfig}
|
|
||||||
'';
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
(lib.mkRenamedOptionModule
|
||||||
|
[ "services" "dwm-status" "order" ]
|
||||||
|
[ "services" "dwm-status" "settings" "order" ]
|
||||||
|
)
|
||||||
|
(lib.mkRemovedOptionModule [
|
||||||
|
"services"
|
||||||
|
"dwm-status"
|
||||||
|
"extraConfig"
|
||||||
|
] "Use services.dwm-status.settings instead.")
|
||||||
|
];
|
||||||
|
|
||||||
###### interface
|
###### interface
|
||||||
|
|
||||||
@ -30,27 +37,41 @@ in
|
|||||||
example = "dwm-status.override { enableAlsaUtils = false; }";
|
example = "dwm-status.override { enableAlsaUtils = false; }";
|
||||||
};
|
};
|
||||||
|
|
||||||
order = lib.mkOption {
|
settings = lib.mkOption {
|
||||||
type = lib.types.listOf (
|
type = lib.types.submodule {
|
||||||
lib.types.enum [
|
freeformType = format.type;
|
||||||
"audio"
|
options.order = lib.mkOption {
|
||||||
"backlight"
|
type = lib.types.listOf (
|
||||||
|
lib.types.enum [
|
||||||
|
"audio"
|
||||||
|
"backlight"
|
||||||
|
"battery"
|
||||||
|
"cpu_load"
|
||||||
|
"network"
|
||||||
|
"time"
|
||||||
|
]
|
||||||
|
);
|
||||||
|
default = [ ];
|
||||||
|
description = ''
|
||||||
|
List of enabled features in order.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
default = { };
|
||||||
|
example = {
|
||||||
|
order = [
|
||||||
"battery"
|
"battery"
|
||||||
"cpu_load"
|
"cpu_load"
|
||||||
"network"
|
|
||||||
"time"
|
"time"
|
||||||
]
|
];
|
||||||
);
|
time = {
|
||||||
|
format = "%F %a %r";
|
||||||
|
update_seconds = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
description = ''
|
description = ''
|
||||||
List of enabled features in order.
|
Config options for dwm-status, see https://github.com/Gerschtli/dwm-status#configuration
|
||||||
'';
|
for available options.
|
||||||
};
|
|
||||||
|
|
||||||
extraConfig = lib.mkOption {
|
|
||||||
type = lib.types.lines;
|
|
||||||
default = "";
|
|
||||||
description = ''
|
|
||||||
Extra config in TOML format.
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -62,7 +83,7 @@ in
|
|||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
||||||
services.upower.enable = lib.mkIf (lib.elem "battery" cfg.order) true;
|
services.upower.enable = lib.mkIf (lib.elem "battery" cfg.settings.order) true;
|
||||||
|
|
||||||
systemd.user.services.dwm-status = {
|
systemd.user.services.dwm-status = {
|
||||||
description = "Highly performant and configurable DWM status service";
|
description = "Highly performant and configurable DWM status service";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user