Skip to content

Commit b8f59d0

Browse files
Better systemd dependencies on nix
specifically, have the client wait for network-online.target instead of just network.target
1 parent 8d6f71c commit b8f59d0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

nix/module.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ let inherit (lib) types;
5252
];
5353

5454
commonSystemdService = {
55-
after = [ "network.target" ];
5655
# TODO should this actually be put earlier, since I405-tunnel is kinda part of the network?
5756
wantedBy = [ "multi-user.target" ];
5857
path = [ pkgs.iproute2 ];
@@ -145,6 +144,7 @@ in
145144
commonSystemdService
146145
{
147146
description = "I405-Tunnel Server";
147+
after = [ "network.target" ]; # generally will be good enough for our bind IP to be assigned
148148
# it's simple enough to use ExecStart, but I know there are some weird escaping rules
149149
# applied to ExecStart that I'd rather avoid.
150150
script = let allArgs = ["server"] ++ commonCliArgs cfg;
@@ -178,6 +178,8 @@ in
178178
commonSystemdService
179179
{
180180
description = "I405-Tunnel Client";
181+
# unlike the server, we want to wait until we can actually connect to the server before attempting to do so
182+
after = [ "network-online.target" ];
181183
script = let allArgs = (
182184
["client"]
183185
++ ["--peer" cfg.peer]

0 commit comments

Comments
 (0)