36 lines
927 B
Nix
36 lines
927 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.services.swaynotificationcenter;
|
|
in {
|
|
options.services.swaynotificationcenter = with lib; {
|
|
enable = lib.mkEnableOption "SwayNotificationCenter daemon";
|
|
|
|
package = lib.mkOption {
|
|
type = types.package;
|
|
default = pkgs.swaynotificationcenter;
|
|
description = "The SwayNotificationCenter package to use.";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
systemd.user.services.swaync = {
|
|
description = "SwayNotificationCenter daemon";
|
|
wantedBy = [ "graphical-session.target" ];
|
|
partOf = [ "graphical-session.target" ];
|
|
after = [ "graphical-session-pre.target" ];
|
|
|
|
serviceConfig = {
|
|
Type = "simple";
|
|
ExecStart = "${cfg.package}/bin/swaync";
|
|
Restart = "on-failure";
|
|
RestartSec = 1;
|
|
TimeoutStopSec = 10;
|
|
};
|
|
};
|
|
|
|
environment.systemPackages = [ cfg.package ];
|
|
};
|
|
}
|