2024-12-20 22:37:44 -05:00
|
|
|
{
|
|
|
|
|
config,
|
|
|
|
|
lib,
|
|
|
|
|
...
|
|
|
|
|
}:
|
2024-12-20 21:06:04 -05:00
|
|
|
|
|
|
|
|
{
|
2024-12-20 22:37:44 -05:00
|
|
|
imports = [ ];
|
2024-12-20 21:06:04 -05:00
|
|
|
|
2025-10-11 00:08:02 -04:00
|
|
|
options.me = {
|
|
|
|
|
firewall.enable = lib.mkOption {
|
|
|
|
|
type = lib.types.bool;
|
|
|
|
|
default = false;
|
|
|
|
|
example = true;
|
|
|
|
|
description = "Whether we want to install firewall.";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
config = lib.mkIf config.me.firewall.enable {
|
|
|
|
|
# Open ports in the firewall.
|
|
|
|
|
networking.firewall.allowedTCPPorts = [
|
|
|
|
|
22 # ssh
|
|
|
|
|
];
|
|
|
|
|
networking.firewall.allowedUDPPorts = [
|
|
|
|
|
5353 # mDNS
|
|
|
|
|
];
|
|
|
|
|
# Or disable the firewall altogether.
|
|
|
|
|
# networking.firewall.enable = false;
|
|
|
|
|
};
|
2024-12-20 21:06:04 -05:00
|
|
|
}
|