secrets 2
This commit is contained in:
@@ -31,7 +31,7 @@
|
|||||||
deluge.enable = true;
|
deluge.enable = true;
|
||||||
wireguard-netns = {
|
wireguard-netns = {
|
||||||
enable = true;
|
enable = true;
|
||||||
namespace = "vpn";
|
namespace = "vpn2";
|
||||||
configFile = config.age.secrets.wgCredentials.path;
|
configFile = config.age.secrets.wgCredentials.path;
|
||||||
privateIP = "10.68.145.193";
|
privateIP = "10.68.145.193";
|
||||||
dnsIP = "10.64.0.1";
|
dnsIP = "10.64.0.1";
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ in {
|
|||||||
RemainAfterExit = true;
|
RemainAfterExit = true;
|
||||||
ExecStart = with pkgs;
|
ExecStart = with pkgs;
|
||||||
writers.writeBash "wg-up" ''
|
writers.writeBash "wg-up" ''
|
||||||
set -eux
|
set -e
|
||||||
${iproute2}/bin/ip link add wg1 type wireguard
|
${iproute2}/bin/ip link add wg1 type wireguard
|
||||||
${iproute2}/bin/ip link set wg1 netns ${cfg.namespace}
|
${iproute2}/bin/ip link set wg1 netns ${cfg.namespace}
|
||||||
${iproute2}/bin/ip -n ${cfg.namespace} address add ${cfg.privateIP} dev wg1
|
${iproute2}/bin/ip -n ${cfg.namespace} address add ${cfg.privateIP} dev wg1
|
||||||
@@ -60,7 +60,7 @@ in {
|
|||||||
'';
|
'';
|
||||||
ExecStop = with pkgs;
|
ExecStop = with pkgs;
|
||||||
writers.writeBash "wg-down" ''
|
writers.writeBash "wg-down" ''
|
||||||
set -eux
|
set -e
|
||||||
${iproute2}/bin/ip -n ${cfg.namespace} route del default dev wg1
|
${iproute2}/bin/ip -n ${cfg.namespace} route del default dev wg1
|
||||||
${iproute2}/bin/ip -n ${cfg.namespace} link del wg1
|
${iproute2}/bin/ip -n ${cfg.namespace} link del wg1
|
||||||
'';
|
'';
|
||||||
|
|||||||
Reference in New Issue
Block a user