1 { config, lib, pkgs, ... }:
6 cfg = config.services.dwm-status;
8 order = concatMapStringsSep "," (feature: ''"${feature}"'') cfg.order;
10 configFile = pkgs.writeText "dwm-status.toml" ''
23 services.dwm-status = {
25 enable = mkEnableOption (lib.mdDoc "dwm-status user service");
29 default = pkgs.dwm-status;
30 defaultText = literalExpression "pkgs.dwm-status";
31 example = literalExpression "pkgs.dwm-status.override { enableAlsaUtils = false; }";
32 description = lib.mdDoc ''
33 Which dwm-status package to use.
38 type = types.listOf (types.enum [ "audio" "backlight" "battery" "cpu_load" "network" "time" ]);
39 description = lib.mdDoc ''
40 List of enabled features in order.
44 extraConfig = mkOption {
47 description = lib.mdDoc ''
48 Extra config in TOML format.
59 config = mkIf cfg.enable {
61 services.upower.enable = elem "battery" cfg.order;
63 systemd.user.services.dwm-status = {
64 description = "Highly performant and configurable DWM status service";
65 wantedBy = [ "graphical-session.target" ];
66 partOf = [ "graphical-session.target" ];
68 serviceConfig.ExecStart = "${cfg.package}/bin/dwm-status ${configFile}";