From c2dc65583cecc9af621c6042dfa4bc3759ff3e13 Mon Sep 17 00:00:00 2001 From: TEC Date: Mon, 11 Dec 2023 00:45:11 +0800 Subject: [PATCH] Refactor network (port) config Turns out I can put :22 in admin.nix and it still works, which is more appropriate. --- modules/admin.nix | 1 + modules/caddy.nix | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/admin.nix b/modules/admin.nix index 33e3e6d..553b704 100644 --- a/modules/admin.nix +++ b/modules/admin.nix @@ -1,6 +1,7 @@ { config, pkgs, ... }: { + networking.firewall.allowedTCPPorts = [ 22 ]; users.users.admin = { name = "admin"; hashedPassword = "$6$ET8BLqODvw77VOmI$oun2gILUqBr/3WonH2FO1L.myMIM80KeyO5W1GrYhJTo./jk7XcG8B3vEEcbpfx3R9h.sR0VV187/MgnsnouB1"; diff --git a/modules/caddy.nix b/modules/caddy.nix index 93016c1..3e5d237 100644 --- a/modules/caddy.nix +++ b/modules/caddy.nix @@ -3,8 +3,8 @@ with lib; { - networking.firewall.allowedTCPPorts = [ 22 80 443 ]; - networking.firewall.allowedUDPPortRanges = [ { from=443; to=443; } ]; + networking.firewall.allowedTCPPorts = [ 80 443 ]; + networking.firewall.allowedUDPPorts = [ 443 ]; # If I end up wanting to add plugins, see: # https://mdleom.com/blog/2021/12/27/caddy-plugins-nixos/