mirror of
https://github.com/librephoenix/nixos-config
synced 2025-10-19 10:04:03 +05:30
Major config overhaul: use custom modules, setup for multi-host config, and less boilerplate
This commit is contained in:
parent
1fa8b17b07
commit
0453901d17
303 changed files with 3560 additions and 5566 deletions
22
modules/system/security/firewall/default.nix
Normal file
22
modules/system/security/firewall/default.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.systemSettings.security.firewall;
|
||||
in {
|
||||
options = {
|
||||
systemSettings.security.firewall = {
|
||||
# TODO make this more granular and better :|
|
||||
enable = lib.mkEnableOption "Actvate firewall with ports open only for syncthing";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Firewall
|
||||
networking.firewall.enable = true;
|
||||
# Open ports in the firewall.
|
||||
networking.firewall.allowedTCPPorts = [ 22000 21027 ]; # syncthing
|
||||
networking.firewall.allowedUDPPorts = [ 22000 21027 ]; # syncthing
|
||||
# Or disable the firewall altogether.
|
||||
# networking.firewall.enable = false;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue