treewide: lay base for shared configuration with darwin machines

This commit is contained in:
Charlotte Van Petegem 2024-07-18 11:01:12 +02:00
parent 73a5e1e56e
commit 3f958ff6d6
10 changed files with 57 additions and 74 deletions

View file

@ -128,26 +128,6 @@ in
];
};
};
services = {
udp2raw-server = lib.mkIf config.chvp.base.network.wireguard.server {
description = "UDP tunnel over TCP for wireguard";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
script = ''
${pkgs.udp2raw}/bin/udp2raw -s -l 0.0.0.0:8080 -r 127.0.0.1:51820 \
-k "$(cat ${config.age.secrets."files/wireguard/udp2raw".path})"
'';
};
udp2raw-client = lib.mkIf config.chvp.base.network.wireguard.onCorporate {
description = "UDP tunnel over TCP for wireguard";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
script = ''
${pkgs.udp2raw}/bin/udp2raw -c -l 127.0.0.1:51820 -r 54.38.222.69:8080 \
-k "$(cat ${config.age.secrets."files/wireguard/udp2raw".path})"
'';
};
};
};
age.secrets."files/wireguard/psk" = {
file = ../../../secrets/files/wireguard/psk.age;
@ -157,6 +137,5 @@ in
file = ../../../secrets/files/wireguard + "/${config.networking.hostName}.privkey.age";
owner = "systemd-network";
};
age.secrets."files/wireguard/udp2raw".file = ../../../secrets/files/wireguard/udp2raw.age;
};
}