-
Notifications
You must be signed in to change notification settings - Fork 1
/
systemd.nix
67 lines (67 loc) · 1.6 KB
/
systemd.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{
config,
pkgs,
lib,
setEnvironment,
...
}: {
systemd.user.services = {
waybar = {
Unit = {
Description = pkgs.waybar.meta.description;
PartOf = ["graphical-session.target"];
};
Install = {
WantedBy = ["sway-session.target"];
};
Service = {
ExecStart = "${pkgs.waybar}/bin/waybar";
RestartSec = 3;
Restart = "always";
};
};
mako = {
Unit = {
Description = pkgs.mako.meta.description;
PartOf = ["graphical-session.target"];
};
Install = {
WantedBy = ["sway-session.target"];
};
Service = {
ExecStart = "${pkgs.mako}/bin/mako --default-timeout 10000";
RestartSec = 3;
Restart = "always";
};
};
udiskie = {
Unit = {
Description = pkgs.udiskie.meta.description;
PartOf = ["graphical-session.target"];
};
Install = {
WantedBy = ["sway-session.target"];
};
Service = {
ExecStart = "${pkgs.udiskie}/bin/udiskie";
RestartSec = 3;
Restart = "always";
};
};
emacs = {
Unit = {
Description = "Emacs text editor";
After = ["graphical-session.target"];
};
Install = {
WantedBy = ["default.target"];
};
Service = {
Type = "forking";
ExecStart = "${pkgs.bash}/bin/bash -c 'source ${setEnvironment}; exec ${config.programs.emacs.finalPackage}/bin/emacs --daemon'";
ExecStop = "${pkgs.emacs}/bin/emacsclient --eval \"(kill-emacs)\"";
Restart = "always";
};
};
};
}