diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2021-01-03 01:14:47 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2021-01-03 16:21:34 +0100 |
commit | 392e6768f9f60c761b65f8774c1667ab8d00f230 (patch) | |
tree | e84d0439a01402e3bd85a627c6594526f1d0a8ed /accounts/gkleen@sif/systemd.nix | |
parent | 4a3d2a8ddaf4e546df360656bc54b2947bdb890b (diff) | |
download | nixos-392e6768f9f60c761b65f8774c1667ab8d00f230.tar nixos-392e6768f9f60c761b65f8774c1667ab8d00f230.tar.gz nixos-392e6768f9f60c761b65f8774c1667ab8d00f230.tar.bz2 nixos-392e6768f9f60c761b65f8774c1667ab8d00f230.tar.xz nixos-392e6768f9f60c761b65f8774c1667ab8d00f230.zip |
gkleen@sif: systemd
Diffstat (limited to 'accounts/gkleen@sif/systemd.nix')
-rw-r--r-- | accounts/gkleen@sif/systemd.nix | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/accounts/gkleen@sif/systemd.nix b/accounts/gkleen@sif/systemd.nix new file mode 100644 index 00000000..c6ec6f64 --- /dev/null +++ b/accounts/gkleen@sif/systemd.nix | |||
@@ -0,0 +1,107 @@ | |||
1 | { pkgs, config, userName, ... }: | ||
2 | let | ||
3 | xmobar = import ./xmobar pkgs.haskellPackages; | ||
4 | cfg = config.home-manager.users.${userName}; | ||
5 | in { | ||
6 | services = { | ||
7 | "dynamic-forward@" = { | ||
8 | Service = { | ||
9 | WorkingDirectory = "~"; | ||
10 | ExecStart = "${pkgs.autossh}/bin/autossh -M 20000 -- -vN -o ControlMaster=no \"%I\""; | ||
11 | Environment = [ "AUTOSSH_POLL=30" "AUTOSSH_PIDFILE=.ssh/autossh.%i.pid" ]; | ||
12 | PIDFile = "~/.ssh/autossh.%i.pid"; | ||
13 | Restart = "on-failure"; | ||
14 | RestartSec = "30"; | ||
15 | }; | ||
16 | Install = { | ||
17 | WantedBy = ["default.target"]; | ||
18 | }; | ||
19 | }; | ||
20 | sync-keepass = { | ||
21 | Service = { | ||
22 | Type = "oneshot"; | ||
23 | WorkingDirectory = "~"; | ||
24 | ExecStart = "${pkgs.lftp}/bin/lftp -f ${./store.kdbx.lftp}"; | ||
25 | }; | ||
26 | }; | ||
27 | urxvtd = { | ||
28 | Service = { | ||
29 | Type = "simple"; | ||
30 | WorkingDirectory = "~"; | ||
31 | ExecStart = "${cfg.programs.urxvt.package}/bin/urxvtd"; | ||
32 | Restart = "always"; | ||
33 | }; | ||
34 | Unit = { | ||
35 | After = ["graphical-session.target"]; | ||
36 | }; | ||
37 | Install = { | ||
38 | WantedBy = ["graphical-session.target"]; | ||
39 | }; | ||
40 | }; | ||
41 | emacs = { | ||
42 | Unit = { | ||
43 | After = ["graphical-session-pre.target"]; | ||
44 | }; | ||
45 | }; | ||
46 | trayer = { | ||
47 | Service = { | ||
48 | Type = "simple"; | ||
49 | WorkingDirectory = "~"; | ||
50 | ExecStart = "${pkgs.trayer}/bin/trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand true --width 8 --tint 0x000000 --alpha 0 --transparent true --height 32 --monitor primary"; | ||
51 | Restart = "always"; | ||
52 | }; | ||
53 | Install = { | ||
54 | WantedBy = ["graphical-session.target"]; | ||
55 | }; | ||
56 | }; | ||
57 | xmobar = { | ||
58 | Service = { | ||
59 | Type = "simple"; | ||
60 | WorkingDirectory = "~"; | ||
61 | ExecStart = "${xmobar}/bin/xmobar"; | ||
62 | Restart = "always"; | ||
63 | Environment = "PATH=${pkgs.worktime}/bin:${pkgs.openssh}/bin"; | ||
64 | |||
65 | }; | ||
66 | Install = { | ||
67 | WantedBy = ["graphical-session.target"]; | ||
68 | }; | ||
69 | }; | ||
70 | dunst = { | ||
71 | Service = { | ||
72 | Restart = "always"; | ||
73 | }; | ||
74 | Install = { | ||
75 | WantedBy = ["graphical-session.target"]; | ||
76 | }; | ||
77 | }; | ||
78 | xiccd = { | ||
79 | Service = { | ||
80 | Type = "simple"; | ||
81 | WorkingDirectory = "~"; | ||
82 | ExecStart = "${pkgs.xiccd}/bin/xiccd"; | ||
83 | Restart = "always"; | ||
84 | }; | ||
85 | }; | ||
86 | }; | ||
87 | timers = { | ||
88 | sync-keepass = { | ||
89 | Timer = { | ||
90 | OnActiveSec = "1m"; | ||
91 | OnUnitActiveSec = "1m"; | ||
92 | }; | ||
93 | |||
94 | Install = { | ||
95 | WantedBy = ["default.target"]; | ||
96 | }; | ||
97 | }; | ||
98 | }; | ||
99 | targets = { | ||
100 | graphical-session = { | ||
101 | Unit = { | ||
102 | BindsTo = ["default.target"]; | ||
103 | After = ["basic.target"]; | ||
104 | }; | ||
105 | }; | ||
106 | }; | ||
107 | } | ||