petalius: use resolved

This commit is contained in:
Gabriel Ebner 2019-10-03 12:30:33 +02:00
parent 1a456bef2a
commit 6c86c80e07

@ -99,17 +99,21 @@
privateKeyFile = "/etc/wgkeys/petalius"; privateKeyFile = "/etc/wgkeys/petalius";
allowedIPsAsRoutes = true; allowedIPsAsRoutes = true;
postSetup = '' postSetup = ''
printf "nameserver 10.58.0.1" | ${pkgs.openresolv}/bin/resolvconf -a wg0 -m 0 ${pkgs.systemd}/bin/resolvectl domain wg0 '~htdf.gebner.org' '~mtlaa.gebner.org'
''; ${pkgs.systemd}/bin/resolvectl dns wg0 10.58.0.1
postShutdown = ''
${pkgs.openresolv}/bin/resolvconf -d wg0
''; '';
peers = [{ peers = [{
publicKey = "ByLlJbevlTBooAo2RIZGGJvBHKqA9qiOpHBvR5yuJX4="; publicKey = "ByLlJbevlTBooAo2RIZGGJvBHKqA9qiOpHBvR5yuJX4=";
allowedIPs = ["10.56.0.0/14" "10.60.1.1"]; allowedIPs = ["10.56.0.0/14" "10.60.1.1"];
endpoint = "htdf-gw.gebner.org:35869"; # endpoint = "htdf-gw.gebner.org:35869";
endpoint = "80.109.2.154:35869";
}]; }];
}; };
systemd.services.wireguard-wg0.wantedBy = pkgs.lib.mkOverride 10 []; systemd.services.wireguard-wg0.wantedBy = pkgs.lib.mkOverride 10 [];
services.resolved = {
domains = [];
enable = true;
};
} }