simplify firewall config

This commit is contained in:
Vinzenz Schroeter 2024-03-02 13:02:14 +01:00
parent 4f1138c9e3
commit 3945a335b1
5 changed files with 9 additions and 39 deletions

View file

@ -9,7 +9,6 @@
config = { config = {
my = { my = {
enabledUsers = []; enabledUsers = [];
server.enable = true;
tailscale.enable = true; tailscale.enable = true;
}; };
@ -64,15 +63,6 @@
}; };
}; };
networking.firewall = { networking.firewall.allowedTCPPorts = [80 443];
checkReversePath = "loose";
allowedTCPPortRanges = [
{
from = 5000;
to = 5005;
}
];
allowedTCPPorts = [80 443];
};
}; };
} }

View file

@ -4,7 +4,6 @@ modulesCfg: {lib, ...}: {
./i18n.nix ./i18n.nix
./nixpkgs.nix ./nixpkgs.nix
./globalinstalls.nix ./globalinstalls.nix
./server.nix
./sshd.nix ./sshd.nix
./tailscale.nix ./tailscale.nix
./buildtools.nix ./buildtools.nix
@ -17,5 +16,10 @@ modulesCfg: {lib, ...}: {
config = { config = {
my.modulesCfg = modulesCfg; my.modulesCfg = modulesCfg;
networking.firewall = {
enable = true;
checkReversePath = "loose";
};
}; };
} }

View file

@ -59,7 +59,6 @@ in {
networkmanager.enable = true; networkmanager.enable = true;
firewall = { firewall = {
enable = true;
allowedTCPPortRanges = [ allowedTCPPortRanges = [
{ {
# KDE Connect / gsconnect # KDE Connect / gsconnect

View file

@ -41,12 +41,9 @@ in {
}; };
}; };
networking.firewall.allowedUDPPortRanges = [ networking.firewall.allowedUDPPorts = [
{ # Factorio
# Factorio 34197
from = 34197;
to = 34197;
}
]; ];
my.allowUnfreePackages = [ my.allowUnfreePackages = [

View file

@ -1,20 +0,0 @@
{
config,
pkgs,
lib,
...
}: let
cfg = config.my.server;
in {
options.my.server = {
enable = lib.mkEnableOption "server role";
};
config = lib.mkIf cfg.enable {
networking.firewall = {
enable = true;
allowedTCPPortRanges = [
];
};
};
}