Only enable the firewall if there's an external interface specified
This commit is contained in:
parent
9d3808fe2d
commit
4a7c4a9469
@ -119,6 +119,12 @@ let
|
|||||||
description = "SSH public keys used to access the build server.";
|
description = "SSH public keys used to access the build server.";
|
||||||
default = [ ];
|
default = [ ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
external-interfaces = mkOption {
|
||||||
|
type = listOf str;
|
||||||
|
description = "A list of interfaces on which to enable the firewall.";
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -155,6 +161,11 @@ in {
|
|||||||
"127.0.0.1" = [ "${hostname}.${domain-name}" "${hostname}" ];
|
"127.0.0.1" = [ "${hostname}.${domain-name}" "${hostname}" ];
|
||||||
"::1" = [ "${hostname}.${domain-name}" "${hostname}" ];
|
"::1" = [ "${hostname}.${domain-name}" "${hostname}" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
firewall = {
|
||||||
|
enable = (length host-cfg.external-interfaces) > 0;
|
||||||
|
allowedTCPPorts = [ 22 ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.etc.hosts = mkForce {
|
environment.etc.hosts = mkForce {
|
||||||
|
Loading…
Reference in New Issue
Block a user