modules/wireguard: use domain-specific DNS
This commit is contained in:
parent
f721a54007
commit
0b8e4e2fab
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
|
pkgs,
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
|
@ -32,10 +33,8 @@ in {
|
||||||
ips = cfg.ownIPs;
|
ips = cfg.ownIPs;
|
||||||
privateKeyFile = cfg.privateKeyFile;
|
privateKeyFile = cfg.privateKeyFile;
|
||||||
postSetup = ''
|
postSetup = ''
|
||||||
printf "nameserver 10.0.66.10\nnameserver 10.0.66.12" | resolvconf -a wg-ehex -m 0 -x
|
${pkgs.systemd}/bin/resolvectl dns wg-ehex 10.0.66.10 10.0.66.12
|
||||||
'';
|
${pkgs.systemd}/bin/resolvectl domain wg-ehex ehex.cloud
|
||||||
postShutdown = ''
|
|
||||||
resolvconf -d wg-ehex -f
|
|
||||||
'';
|
'';
|
||||||
peers = [
|
peers = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -57,7 +57,8 @@ in {
|
||||||
+ (
|
+ (
|
||||||
if cfg.useDNS
|
if cfg.useDNS
|
||||||
then ''
|
then ''
|
||||||
printf "nameserver 10.13.12.7\nnameserver fd00:b12f:acab:1312:acab:7::" | resolvconf -a wg-private -m 0 -x
|
${pkgs.systemd}/bin/resolvectl dns wg-private 10.13.12.7 fd00:b12f:acab:1312:acab:7::
|
||||||
|
${pkgs.systemd}/bin/resolvectl domain wg-private ~.
|
||||||
''
|
''
|
||||||
else ""
|
else ""
|
||||||
)
|
)
|
||||||
|
@ -76,9 +77,6 @@ in {
|
||||||
''
|
''
|
||||||
else ""
|
else ""
|
||||||
);
|
);
|
||||||
postShutdown = lib.mkIf cfg.useDNS ''
|
|
||||||
resolvconf -d wg-private -f
|
|
||||||
'';
|
|
||||||
peers = [
|
peers = [
|
||||||
{
|
{
|
||||||
# frikandel
|
# frikandel
|
||||||
|
|
Loading…
Reference in a new issue