summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/systemd.nix
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/gkleen@sif/systemd.nix')
-rw-r--r--accounts/gkleen@sif/systemd.nix38
1 files changed, 24 insertions, 14 deletions
diff --git a/accounts/gkleen@sif/systemd.nix b/accounts/gkleen@sif/systemd.nix
index a32e61b2..06eaef4f 100644
--- a/accounts/gkleen@sif/systemd.nix
+++ b/accounts/gkleen@sif/systemd.nix
@@ -90,26 +90,36 @@ in {
90 StartLimitBurst = 7; 90 StartLimitBurst = 7;
91 }; 91 };
92 }; 92 };
93 "proxy-to-autossh-socks@8118" = { 93 "autossh-socks@proxy.mathw0h:8121" = {
94 Unit = {
95 Requires = ["autossh-socks@proxy.mathw0h:8119.service" "proxy-to-autossh-socks@8118.socket"];
96 After = ["autossh-socks@proxy.mathw0h:8119.service" "proxy-to-autossh-socks@8118.socket"];
97 };
98 Service = { 94 Service = {
99 ExecStart = "${pkgs.systemd}/lib/systemd/systemd-socket-proxyd --exit-idle-time=10s localhost:8119"; 95 Type = "notify";
96 NotifyAccess = "all";
97 WorkingDirectory = "~";
98 Restart = "always";
99 RestartSec = "2s";
100 ExecStart = "${autossh-socks-script} \"%I\"";
101 };
102 Unit = {
103 StopWhenUnneeded = true;
100 }; 104 };
101 }; 105 };
102 }; 106 } // listToAttrs (map (port: nameValuePair "proxy-to-autossh-socks@${port}" {
103 sockets = { 107 Unit = {
104 "proxy-to-autossh-socks@8118" = { 108 Requires = ["autossh-socks@proxy.mathw0h:${port + 1}.service" "proxy-to-autossh-socks@${port}.socket"];
105 Socket = { 109 After = ["autossh-socks@proxy.mathw0h:${port + 1}.service" "proxy-to-autossh-socks@${port}.socket"];
106 ListenStream = "%I";
107 }; 110 };
108 Install = { 111 Service = {
109 WantedBy = ["default.target"]; 112 ExecStart = "${pkgs.systemd}/lib/systemd/systemd-socket-proxyd --exit-idle-time=10s localhost:${port + 1}";
110 }; 113 };
114 }) [8118 8120]);
115 sockets = listToAttrs (map (port: nameValuePair "proxy-to-autossh-socks@${port}" {
116 Socket = {
117 ListenStream = "%I";
111 }; 118 };
112 }; 119 Install = {
120 WantedBy = ["default.target"];
121 };
122 }) [8118 8120]);
113 timers = { 123 timers = {
114 sync-keepass = { 124 sync-keepass = {
115 Timer = { 125 Timer = {