Compare commits

..
2 Commits
Author SHA1 Message Date
wymiller 292d30f330 Merge branch 'master' into firewall-changes 2026-10-18 18:07:43 -05:00
wymiller 9056f6dcdb mod: firewall changes 2026-10-16 19:15:55 -04:00
3 changed files with 30 additions and 6 deletions
+5 -5
View File
@@ -66,12 +66,12 @@
"The gods themselves will be my meal. Your dear companions my dessert. Upon this world I'll feast, and death shall follow in my wake. All your hate, all your rage, you will render unto me." \ "The gods themselves will be my meal. Your dear companions my dessert. Upon this world I'll feast, and death shall follow in my wake. All your hate, all your rage, you will render unto me." \
"Boring, boring, boring" \ "Boring, boring, boring" \
"Would you be 'happier' had I a 'good reason'?" \ "Would you be 'happier' had I a 'good reason'?" \
"A test of your reflexes!" \ "A test of your reflexes!" \
"Yer a wizard, Wyatt" \ "Yer a wizard, Wyatt" \
"Yer a lizard, Wyatt" \ "Yer a lizard, Wyatt" \
"Po-Tay-To boil em mash em stick em in a stew" \ "Po-Tay-To boil em mash em stick em in a stew" \
"Oh look it's the cutie patootie potato!" \ "Oh look it's the cutie patootie potato!"
"What a charming young man" \ "What a charming young man" \
"Wyatt, you are smart, kind, and resilient. I believe in you no matter what life throws at you! Kick this project's butt!! - Nico" \ "Wyatt, you are smart, kind, and resilient. I believe in you no matter what life throws at you! Kick this project's butt!! - Nico" \
"Ganbatte!" "Ganbatte!"
+4 -1
View File
@@ -151,7 +151,10 @@ in {
# Core networking module (see ../../networking/core.nix) # Core networking module (see ../../networking/core.nix)
network = { network = {
firewall.enable = true; firewall = {
enable = true;
firewalld.enable = true;
};
networkManager.enable = true; networkManager.enable = true;
}; };
+21
View File
@@ -8,6 +8,12 @@ in {
options.network = { options.network = {
firewall = { firewall = {
enable = lib.mkEnableOption "system firewall"; enable = lib.mkEnableOption "system firewall";
firewalld.enable = lib.mkEnableOption "firewalld with its nftables backend";
nftables.extraConfig = lib.mkOption {
type = lib.types.lines;
default = "";
description = "Rules inside a separate inet nftables table alongside firewalld";
};
tcpPorts = { tcpPorts = {
ssh.enable = lib.mkEnableOption "SSH service port (22)"; ssh.enable = lib.mkEnableOption "SSH service port (22)";
web.enable = lib.mkEnableOption "common web service ports (80, 443)"; web.enable = lib.mkEnableOption "common web service ports (80, 443)";
@@ -42,6 +48,21 @@ in {
}; };
}; };
config = { config = {
assertions = [
{
assertion = cfg.firewall.nftables.extraConfig == "" || cfg.firewall.firewalld.enable;
message = "network.firewall.nftables.extraConfig requires network.firewall.firewalld.enable";
}
];
services.firewalld.enable = cfg.firewall.firewalld.enable;
networking.nftables = lib.mkIf cfg.firewall.firewalld.enable {
enable = true;
flushRuleset = false;
tables."local-extra" = lib.mkIf (cfg.firewall.nftables.extraConfig != "") {
family = "inet";
content = cfg.firewall.nftables.extraConfig;
};
};
networking.firewall = { networking.firewall = {
enable = cfg.firewall.enable; enable = cfg.firewall.enable;
allowedTCPPorts = lib.flatten [ allowedTCPPorts = lib.flatten [