swaync: ship as own service

This commit is contained in:
Colin 2023-09-07 07:34:22 +00:00
parent ccb11a4ecf
commit 4c08609824
2 changed files with 16 additions and 2 deletions

View File

@ -64,7 +64,7 @@
# i'm using means that target's never reached...
# TODO: might want `ConditionUser=!@system`
serviceConfig.ExecStart = "${pkgs.mako}/bin/mako";
serviceConfig.ExecStart = "${config.sane.programs.mako.package}/bin/mako";
serviceConfig.Type = "simple";
# mako will predictably fail if launched before the wayland server is fully initialized
serviceConfig.Restart = "on-failure";

View File

@ -13,7 +13,7 @@
# - examples:
# - thread: <https://github.com/ErikReider/SwayNotificationCenter/discussions/183>
# - buttons-grid and menubar: <https://gist.github.com/JannisPetschenka/fb00eec3efea9c7fff8c38a01ce5d507>
{ ... }:
{ config, lib, ... }:
{
sane.programs.swaynotificationcenter = {
fs.".config/swaync/style.css".symlink.text = ''
@ -129,4 +129,18 @@
};
};
};
# TODO: give `sane.programs` native support for defining services
systemd.user.services.swaync = lib.mkIf config.sane.programs.swaynotificationcenter.enabled {
# swaync ships its own service, but i want to add `environment` variables and flags for easier debugging.
# seems that's not possible without defining an entire nix-native service (i.e. this).
description = "Swaync desktop notification daemon";
wantedBy = [ "default.target" ];
serviceConfig.ExecStart = "${config.sane.programs.swaynotificationcenter.package}/bin/swaync";
serviceConfig.Type = "dbus";
serviceConfig.BusName = "org.freedesktop.Notifications";
serviceConfig.Restart = "on-failure";
serviceConfig.RestartSec = "10s";
environment.G_MESSAGES_DEBUG = "all";
};
}