fix(nix): change notification service
This commit is contained in:
parent
1d1804f3fc
commit
d0dc106ccb
3 changed files with 40 additions and 20 deletions
36
nix/modules/swaynotificationcenter.nix
Normal file
36
nix/modules/swaynotificationcenter.nix
Normal file
|
@ -0,0 +1,36 @@
|
|||
{ 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 ];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue