From 45dc1cfe529144c64f49a6aa255a907c9ea02866 Mon Sep 17 00:00:00 2001 From: Random936 Date: Sun, 3 Nov 2024 20:48:50 -0800 Subject: [PATCH] Added open_ports argument to networking file --- config/media.nix | 3 ++- config/networking.nix | 4 ++-- config/sampledb.nix | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/config/media.nix b/config/media.nix index 72ddde8..e6ed270 100644 --- a/config/media.nix +++ b/config/media.nix @@ -4,8 +4,9 @@ ../hardware/media.nix ./headless.nix (import ./networking.nix { - hostname = "sampledb-dev"; + hostname = "r330-media"; ip_address = "192.168.100.40"; + open_ports = [ 80 443 32400 ]; }) ]; diff --git a/config/networking.nix b/config/networking.nix index eccb358..c691976 100644 --- a/config/networking.nix +++ b/config/networking.nix @@ -1,4 +1,4 @@ -{ ip_address, hostname }: +{ ip_address, hostname, open_ports }: { # Configure hostname. networking.hostName = hostname; @@ -16,7 +16,7 @@ }; networking.nameservers = [ "192.168.100.1" ]; - networking.firewall.allowedTCPPorts = [ 80 443 ]; + networking.firewall.allowedTCPPorts = open_ports; networking.interfaces.enp6s18.ipv4.addresses = [ { address = ip_address; diff --git a/config/sampledb.nix b/config/sampledb.nix index 6adf5bd..74befaf 100644 --- a/config/sampledb.nix +++ b/config/sampledb.nix @@ -6,6 +6,7 @@ (import ./networking.nix { hostname = "sampledb-dev"; ip_address = "192.168.100.42"; + open_ports = [ 80 443 ]; }) ];