1 { config, lib, pkgs, ... }:
3 cfg = config.services.dwm-status;
5 order = lib.concatMapStringsSep "," (feature: ''"${feature}"'') cfg.order;
7 configFile = pkgs.writeText "dwm-status.toml" ''
20 services.dwm-status = {
22 enable = lib.mkEnableOption "dwm-status user service";
24 package = lib.mkPackageOption pkgs "dwm-status" {
25 example = "dwm-status.override { enableAlsaUtils = false; }";
28 order = lib.mkOption {
29 type = lib.types.listOf (lib.types.enum [ "audio" "backlight" "battery" "cpu_load" "network" "time" ]);
31 List of enabled features in order.
35 extraConfig = lib.mkOption {
36 type = lib.types.lines;
39 Extra config in TOML format.
50 config = lib.mkIf cfg.enable {
52 services.upower.enable = lib.elem "battery" cfg.order;
54 systemd.user.services.dwm-status = {
55 description = "Highly performant and configurable DWM status service";
56 wantedBy = [ "graphical-session.target" ];
57 partOf = [ "graphical-session.target" ];
59 serviceConfig.ExecStart = "${cfg.package}/bin/dwm-status ${configFile}";