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

View file

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

View file

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

View file

@ -41,12 +41,9 @@ in {
};
};
networking.firewall.allowedUDPPortRanges = [
{
# Factorio
from = 34197;
to = 34197;
}
networking.firewall.allowedUDPPorts = [
# Factorio
34197
];
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 = [
];
};
};
}