refactor: extract 'firewall' and 'wol' modules

This commit is contained in:
2026-02-23 23:40:15 +01:00
parent 34ebb265e6
commit e7c6df1c9b
4 changed files with 88 additions and 23 deletions

View File

@@ -0,0 +1,27 @@
{ lib, config, ... }:
let
inherit (lib) mkEnableOption mkOption types;
in
{
options.firewall = {
enable = mkEnableOption "firewall";
allowedTCPPorts = mkOption {
type = types.listOf types.port;
default = [ ];
};
allowedUDPPorts = mkOption {
type = types.listOf types.port;
default = [ ];
};
};
config = lib.mkIf config.firewall.enable {
networking.firewall = {
enable = true;
inherit (config.firewall) allowedTCPPorts allowedUDPPorts;
};
};
}