From 02dd11c8b44b86738340566330003149b02e966b Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Fri, 22 Dec 2023 15:52:34 +0000 Subject: [PATCH] fix: ensure networking remains good --- applications/skynet_users.nix | 7 ++++++- machines/_base.nix | 2 +- machines/agentjones.nix | 17 ++++++++--------- machines/neuromancer.nix | 15 +++++++++------ machines/vendetta.nix | 18 ++++++++---------- 5 files changed, 32 insertions(+), 27 deletions(-) diff --git a/applications/skynet_users.nix b/applications/skynet_users.nix index d90d7df..66c3386 100644 --- a/applications/skynet_users.nix +++ b/applications/skynet_users.nix @@ -57,7 +57,12 @@ in { environment.systemPackages = [pkgs.vim]; - networking.firewall.allowedTCPPorts = [80 443]; + networking = { + defaultGateway = { + address = lib.mkDefault "193.1.96.161"; + interface = lib.mkDefault "eth1"; + }; + }; # normally services cannot read home dirs systemd.services.nginx.serviceConfig.ProtectHome = "read-only"; diff --git a/machines/_base.nix b/machines/_base.nix index 19eac78..4c40420 100644 --- a/machines/_base.nix +++ b/machines/_base.nix @@ -102,7 +102,7 @@ in { # explisitly stating this is good defaultGateway = { address = "193.1.99.65"; - interface = "eno1"; + interface = "eth0"; }; # cannot use our own it seems? diff --git a/machines/agentjones.nix b/machines/agentjones.nix index b2d14f4..51a5bc5 100644 --- a/machines/agentjones.nix +++ b/machines/agentjones.nix @@ -58,15 +58,14 @@ in { networking.hostName = name; # this has to be defined for any physical servers # vms are defined by teh vm host - networking.interfaces = { - eno1 = { - ipv4.addresses = [ - { - address = ip_pub; - prefixLength = 26; - } - ]; - }; + networking = { + defaultGateway.interface = lib.mkDefault "eno1"; + interfaces.eno1.ipv4.addresses = [ + { + address = ip_pub; + prefixLength = 26; + } + ]; }; # this server is teh firewall diff --git a/machines/neuromancer.nix b/machines/neuromancer.nix index 1e4d271..d355fd3 100644 --- a/machines/neuromancer.nix +++ b/machines/neuromancer.nix @@ -26,12 +26,15 @@ in { networking.hostName = name; # this has to be defined for any physical servers # vms are defined by teh vm host - networking.interfaces.eno1.ipv4.addresses = [ - { - address = ip_pub; - prefixLength = 26; - } - ]; + networking = { + defaultGateway.interface = lib.mkDefault "eno1"; + interfaces.eno1.ipv4.addresses = [ + { + address = ip_pub; + prefixLength = 26; + } + ]; + }; deployment = { targetHost = hostname; diff --git a/machines/vendetta.nix b/machines/vendetta.nix index db68a37..24f3d9a 100644 --- a/machines/vendetta.nix +++ b/machines/vendetta.nix @@ -35,16 +35,14 @@ in { networking = { # needs to have an address statically assigned - interfaces = { - eno1 = { - ipv4.addresses = [ - { - address = "193.1.99.120"; - prefixLength = 26; - } - ]; - }; - }; + + defaultGateway.interface = lib.mkDefault "eno1"; + interfaces.eno1.ipv4.addresses = [ + { + address = "193.1.99.120"; + prefixLength = 26; + } + ]; }; services.skynet_backup = {