summaryrefslogtreecommitdiff
path: root/os/srv/firewall.nix
diff options
context:
space:
mode:
Diffstat (limited to 'os/srv/firewall.nix')
-rw-r--r--os/srv/firewall.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/os/srv/firewall.nix b/os/srv/firewall.nix
new file mode 100644
index 0000000..9242007
--- /dev/null
+++ b/os/srv/firewall.nix
@@ -0,0 +1,22 @@
+{ config, lib, ... }:
+let
+ cfg = config.os.srv.firewall;
+in
+{
+ options.os.srv.firewall = {
+ enable = lib.mkEnableOption "enables the firewall";
+ };
+
+ config = lib.mkIf cfg.enable {
+ networking = {
+ nftables.enable = true;
+
+ firewall = {
+ enable = true;
+
+ allowedTCPPorts = [ ];
+ allowedUDPPorts = [ ];
+ };
+ };
+ };
+}