summaryrefslogtreecommitdiff
path: root/hosts/kay/modules/network.nix
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/kay/modules/network.nix')
-rw-r--r--hosts/kay/modules/network.nix43
1 files changed, 21 insertions, 22 deletions
diff --git a/hosts/kay/modules/network.nix b/hosts/kay/modules/network.nix
index 12788c6..95832d8 100644
--- a/hosts/kay/modules/network.nix
+++ b/hosts/kay/modules/network.nix
@@ -3,14 +3,11 @@
let
inetVlan = 722;
wanInterface = "enp4s0";
- domain = config.userdata.domain;
nameServer = "1.0.0.1";
+ domain = config.userdata.domain;
in
{
- imports = [
- ./wireguard.nix
- ./router.nix
- ];
+ imports = [ ./router.nix ];
sops.secrets = {
"ppp/chap-secrets" = {};
@@ -20,7 +17,6 @@ in
};
networking = {
- enableIPv6 = false;
vlans.wan = {
id = inetVlan;
interface = wanInterface;
@@ -33,34 +29,37 @@ in
settings.server = [ nameServer ];
};
pppd = {
- secret = {
- chap = config.sops.secrets."ppp/chap-secrets".path;
- pap = config.sops.secrets."ppp/pap-secrets".path;
- };
enable = true;
config = ''
plugin pppoe.so
nic-wan
defaultroute
+ persist
+ mtu 1380
noauth
+ noipv6
'';
- script."01-ddns" = {
- runtimeInputs = with pkgs; [ curl coreutils ];
- text = ''
- wan_ip="$4"
- api_key="$(cat ${config.sops.secrets."misc/namecheap.com".path})"
- auth_url="https://dynamicdns.park-your-domain.com/update?host=@&domain=${domain}&password=''${api_key}&ip="
-
- until curl --silent "$auth_url$wan_ip"; do
- sleep 5
- done
- '';
- };
peers.bsnl = {
enable = true;
autostart = true;
configFile = config.sops.secrets."ppp/username".path;
};
+ secret = {
+ chap = config.sops.secrets."ppp/chap-secrets".path;
+ pap = config.sops.secrets."ppp/pap-secrets".path;
+ };
+ script."01-ddns" = {
+ runtimeInputs = with pkgs; [ curl coreutils ];
+ text = ''
+ wan_ip="$4"
+ api_key="$(cat ${config.sops.secrets."misc/namecheap.com".path})"
+ auth_url="https://dynamicdns.park-your-domain.com/update?host=@&domain=${domain}&password=''${api_key}&ip="
+
+ until curl --silent "$auth_url$wan_ip"; do
+ sleep 5
+ done
+ '';
+ };
};
};
}