mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-31 10:58:02 +00:00
hosts/ni/networking/setup: add common setup option
This commit is contained in:
parent
c64c8018b8
commit
dea3b55aed
@ -7,6 +7,17 @@ in
|
|||||||
{
|
{
|
||||||
options.hosts.ni.networking = {
|
options.hosts.ni.networking = {
|
||||||
enable = lib.mkEnableOption "networking setup";
|
enable = lib.mkEnableOption "networking setup";
|
||||||
|
|
||||||
|
enableCommonSetup = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Whether to enable opening TCP ports and configuring network-related
|
||||||
|
settings typically used for easy networking with clients.
|
||||||
|
'';
|
||||||
|
example = false;
|
||||||
|
};
|
||||||
|
|
||||||
setup = lib.mkOption {
|
setup = lib.mkOption {
|
||||||
type = lib.types.enum [ "networkd" "networkmanager" ];
|
type = lib.types.enum [ "networkd" "networkmanager" ];
|
||||||
description = ''
|
description = ''
|
||||||
@ -139,5 +150,18 @@ in
|
|||||||
interfaces = [ "enp1s0" "wlp2s0" ];
|
interfaces = [ "enp1s0" "wlp2s0" ];
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
|
(lib.mkIf cfg.enableCommonSetup {
|
||||||
|
state.ports = {
|
||||||
|
http = {
|
||||||
|
value = 80;
|
||||||
|
openFirewall = true;
|
||||||
|
};
|
||||||
|
https = {
|
||||||
|
value = 443;
|
||||||
|
openFirewall = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user