Merge pull request #9 from Maroka-chan/fix/wg-on-boot
Require wg.service and start on boot
This commit is contained in:
@@ -115,6 +115,10 @@ in {
|
|||||||
)
|
)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
systemd.services."container@jellyfin" = mkIf cfg.vpn.enable {
|
||||||
|
requires = ["wg.service"];
|
||||||
|
};
|
||||||
|
|
||||||
containers.jellyfin = mkIf cfg.vpn.enable {
|
containers.jellyfin = mkIf cfg.vpn.enable {
|
||||||
autoStart = true;
|
autoStart = true;
|
||||||
ephemeral = true;
|
ephemeral = true;
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ in {
|
|||||||
)
|
)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
systemd.services."container@lidarr" = mkIf cfg.vpn.enable {
|
||||||
|
requires = ["wg.service"];
|
||||||
|
};
|
||||||
|
|
||||||
containers.lidarr = mkIf cfg.vpn.enable {
|
containers.lidarr = mkIf cfg.vpn.enable {
|
||||||
autoStart = true;
|
autoStart = true;
|
||||||
ephemeral = true;
|
ephemeral = true;
|
||||||
|
|||||||
@@ -45,6 +45,10 @@ in {
|
|||||||
)
|
)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
systemd.services."container@prowlarr" = mkIf cfg.vpn.enable {
|
||||||
|
requires = ["wg.service"];
|
||||||
|
};
|
||||||
|
|
||||||
containers.prowlarr = mkIf cfg.vpn.enable {
|
containers.prowlarr = mkIf cfg.vpn.enable {
|
||||||
autoStart = true;
|
autoStart = true;
|
||||||
ephemeral = true;
|
ephemeral = true;
|
||||||
|
|||||||
@@ -43,6 +43,10 @@ in {
|
|||||||
)
|
)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
systemd.services."container@radarr" = mkIf cfg.vpn.enable {
|
||||||
|
requires = ["wg.service"];
|
||||||
|
};
|
||||||
|
|
||||||
containers.radarr = mkIf cfg.vpn.enable {
|
containers.radarr = mkIf cfg.vpn.enable {
|
||||||
autoStart = true;
|
autoStart = true;
|
||||||
ephemeral = true;
|
ephemeral = true;
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ in {
|
|||||||
)
|
)
|
||||||
];
|
];
|
||||||
|
|
||||||
|
systemd.services."container@readarr" = mkIf cfg.vpn.enable {
|
||||||
|
requires = ["wg.service"];
|
||||||
|
};
|
||||||
|
|
||||||
containers.readarr = mkIf cfg.vpn.enable {
|
containers.readarr = mkIf cfg.vpn.enable {
|
||||||
autoStart = true;
|
autoStart = true;
|
||||||
ephemeral = true;
|
ephemeral = true;
|
||||||
|
|||||||
@@ -44,6 +44,10 @@ in {
|
|||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
|
systemd.services."container@sonarr" = mkIf cfg.vpn.enable {
|
||||||
|
requires = ["wg.service"];
|
||||||
|
};
|
||||||
|
|
||||||
containers.sonarr = mkIf cfg.vpn.enable {
|
containers.sonarr = mkIf cfg.vpn.enable {
|
||||||
autoStart = true;
|
autoStart = true;
|
||||||
ephemeral = true;
|
ephemeral = true;
|
||||||
|
|||||||
@@ -119,6 +119,10 @@ in {
|
|||||||
openTcpPorts = [cfg.peerPort];
|
openTcpPorts = [cfg.peerPort];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.services."container@transmission" = mkIf cfg.vpn.enable {
|
||||||
|
requires = ["wg.service"];
|
||||||
|
};
|
||||||
|
|
||||||
containers.transmission = mkIf cfg.vpn.enable {
|
containers.transmission = mkIf cfg.vpn.enable {
|
||||||
autoStart = true;
|
autoStart = true;
|
||||||
ephemeral = true;
|
ephemeral = true;
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ in {
|
|||||||
bindsTo = ["netns@wg.service"];
|
bindsTo = ["netns@wg.service"];
|
||||||
requires = ["network-online.target"];
|
requires = ["network-online.target"];
|
||||||
after = ["netns@wg.service"];
|
after = ["netns@wg.service"];
|
||||||
wantedBy = ["netns@wg.service"];
|
wantedBy = ["multi-user.target"];
|
||||||
|
|
||||||
serviceConfig = let
|
serviceConfig = let
|
||||||
lines = split "\n" (readFile cfg.wireguardConfigFile);
|
lines = split "\n" (readFile cfg.wireguardConfigFile);
|
||||||
|
|||||||
Reference in New Issue
Block a user