system/wireguard: fix caramel and client config
This commit is contained in:
parent
f774334203
commit
c4e2846818
2 changed files with 5 additions and 3 deletions
|
|
@ -6,6 +6,7 @@
|
||||||
age.secrets = {
|
age.secrets = {
|
||||||
passwd.file = ../../secrets/passwd.age;
|
passwd.file = ../../secrets/passwd.age;
|
||||||
wpa_conf.file = ../../secrets/wpa_conf.age;
|
wpa_conf.file = ../../secrets/wpa_conf.age;
|
||||||
|
wg_caramel.file = ../../secrets/wg_caramel.age;
|
||||||
};
|
};
|
||||||
imports = with modules.system; [
|
imports = with modules.system; [
|
||||||
inputs.home-manager-porcupine.nixosModule
|
inputs.home-manager-porcupine.nixosModule
|
||||||
|
|
|
||||||
|
|
@ -74,9 +74,10 @@ let
|
||||||
clientConfig = {
|
clientConfig = {
|
||||||
wireguard.interfaces.wg0 =
|
wireguard.interfaces.wg0 =
|
||||||
let
|
let
|
||||||
client = routeBypass."${config.networking.hostName}";
|
client = clients."${config.networking.hostName}";
|
||||||
mappedAdd = lib.concatMapStringsSep "\n" (r: "${pkgs.iproute2}/bin/ip route add ${r} via ${client.gateway} dev ${client.interface}") client.routes;
|
routes = routeBypass."${config.networking.hostName}";
|
||||||
mappedDel = lib.concatMapStringsSep "\n" (r: "${pkgs.iproute2}/bin/ip route del ${r} via ${client.gateway} dev ${client.interface}") client.routes;
|
mappedAdd = lib.concatMapStringsSep "\n" (r: "${pkgs.iproute2}/bin/ip route add ${r} via ${routes.gateway} dev ${routes.interface}") routes.routes;
|
||||||
|
mappedDel = lib.concatMapStringsSep "\n" (r: "${pkgs.iproute2}/bin/ip route del ${r} via ${routes.gateway} dev ${routes.interface}") routes.routes;
|
||||||
in {
|
in {
|
||||||
ips = client.allowedIPs;
|
ips = client.allowedIPs;
|
||||||
listenPort = port;
|
listenPort = port;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue