layne: use common network config
This commit is contained in:
parent
bfa4f3b586
commit
73a4fa77e5
2 changed files with 24 additions and 65 deletions
|
@ -1,45 +1,31 @@
|
||||||
{ lib, ... }: {
|
{ config, ... }: {
|
||||||
imports = [ ./wireguard.nix ];
|
imports = [
|
||||||
networking = {
|
../shared/network.nix
|
||||||
nameservers = [
|
../shared/networkd.nix
|
||||||
"2620:fe::fe#dns.quad9.net"
|
../shared/wireguard.nix
|
||||||
"9.9.9.9#dns.quad9.net"
|
|
||||||
"2620:fe::9#dns.quad9.net"
|
|
||||||
"149.112.112.112#dns.quad9.net"
|
|
||||||
];
|
];
|
||||||
useDHCP = lib.mkDefault false;
|
|
||||||
useNetworkd = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.network = {
|
sops.secrets = {
|
||||||
enable = true;
|
"wireguard/layne/pk" = {
|
||||||
networks = {
|
mode = "400";
|
||||||
"41-ether" = {
|
owner = config.users.users.root.name;
|
||||||
enable = true;
|
group = config.users.users.root.group;
|
||||||
matchConfig = {
|
|
||||||
Type = "ether";
|
|
||||||
};
|
|
||||||
networkConfig = {
|
|
||||||
DHCP = "yes";
|
|
||||||
};
|
|
||||||
dhcpV4Config = {
|
|
||||||
UseDomains = true;
|
|
||||||
};
|
|
||||||
ipv6AcceptRAConfig = {
|
|
||||||
UseDomains = true;
|
|
||||||
};
|
|
||||||
linkConfig = {
|
|
||||||
RequiredForOnline = "yes";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
"wireguard/layne/psk" = {
|
||||||
|
mode = "400";
|
||||||
|
owner = config.users.users.root.name;
|
||||||
|
group = config.users.users.root.group;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.resolved = {
|
nodeconfig.wireguard = {
|
||||||
enable = true;
|
enable = true;
|
||||||
dnssec = "true";
|
listen-port = 51834;
|
||||||
dnsovertls = "true";
|
pk-file = config.sops.secrets."wireguard/layne/pk".path;
|
||||||
domains = [ "~." ];
|
psk-file = config.sops.secrets."wireguard/layne/psk".path;
|
||||||
fallbackDns = [ ];
|
node-ips = [
|
||||||
|
"10.10.10.14/24"
|
||||||
|
"fd7c:585c:c4ae::14/64"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
{ config, ... }: {
|
|
||||||
imports = [ ../shared/wireguard.nix ];
|
|
||||||
|
|
||||||
sops.secrets = {
|
|
||||||
"wireguard/layne/pk" = {
|
|
||||||
mode = "400";
|
|
||||||
owner = config.users.users.root.name;
|
|
||||||
group = config.users.users.root.group;
|
|
||||||
};
|
|
||||||
"wireguard/layne/psk" = {
|
|
||||||
mode = "400";
|
|
||||||
owner = config.users.users.root.name;
|
|
||||||
group = config.users.users.root.group;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
nodeconfig.wireguard = {
|
|
||||||
enable = true;
|
|
||||||
listen-port = 51834;
|
|
||||||
pk-file = config.sops.secrets."wireguard/layne/pk".path;
|
|
||||||
psk-file = config.sops.secrets."wireguard/layne/psk".path;
|
|
||||||
node-ips = [
|
|
||||||
"10.10.10.14/24"
|
|
||||||
"fd7c:585c:c4ae::14/64"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in a new issue