diff options
| author | Jakub Stachurski <j.stachurski@student.utwente.nl> | 2026-02-11 15:33:46 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-11 15:33:46 +0100 |
| commit | f4272650dba86e04863b994bc85165855ac0eb58 (patch) | |
| tree | a6855656f35bc4c351e215827b58a83b4f2a99ec /home-modules/desktop/wayland/mako.nix | |
| parent | bb87f9ebadc3bb5c5158d9fbad9a5acef8c8f692 (diff) | |
| parent | 2f65e7f40e97f6ccb3d164169698033ce1692a76 (diff) | |
Merge branch 'main' into host/omega-relayhost/omega-relay
Diffstat (limited to 'home-modules/desktop/wayland/mako.nix')
| -rw-r--r-- | home-modules/desktop/wayland/mako.nix | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/home-modules/desktop/wayland/mako.nix b/home-modules/desktop/wayland/mako.nix index ddf0a91..99987db 100644 --- a/home-modules/desktop/wayland/mako.nix +++ b/home-modules/desktop/wayland/mako.nix @@ -1,16 +1,49 @@ { + pkgs, config, lib, ... }: +let + cfg = config.homeprogs.mako; +in { - options.homeprogs.mako.enable = lib.mkEnableOption "Enable Mako notification manager"; - config = lib.mkIf config.homeprogs.mako.enable { - services.mako = { - enable = true; + options.homeprogs.mako = { + enable = lib.mkEnableOption "Enable Mako notification manager"; + systemdWantedBy = lib.mkOption { + description = "SystemD targets where mako should start for."; + # TODO: Put a null here, so that we can add a non-persistent default + default = [ ]; + example = [ "hyprland-session.target" ]; + type = lib.types.listOf lib.types.str; + }; + package = lib.mkOption { + description = "mako package to use"; + default = pkgs.mako; + example = pkgs.mako; + type = lib.types.package; }; - xdg.configFile."mako/config".source = ./mako.ini; - }; - + config = lib.mkIf config.homeprogs.mako.enable ({ + home.packages = [ pkgs.mako ]; + xdg.configFile."mako/config" = { + onChange = "${pkgs.mako}/bin/makoctl reload || true"; + source = ./mako.ini; + }; + systemd.user.services.mako = { + Install.WantedBy = config.homeprogs.mako.systemdWantedBy; + Unit = { + Description = "Lightweight Wayland notification daemon"; + Documentation = "man:mako(1)"; + After = "graphical-session.target"; + }; + Service = { + Type = "dbus"; + BusName = "org.freedesktop.Notifications"; + ExecCondition = "/bin/sh -c '[ -n \"$WAYLAND_DISPLAY\" ]'"; + ExecStart = "${cfg.package}/bin/mako"; + ExecReload = "${cfg.package}/bin/makoctl reload"; + }; + }; + }); } |
