Move options to seperate modules so they can be shared between home manager and nixos

This commit is contained in:
2024-06-17 17:43:14 -05:00
parent 8f66309008
commit 4910af0d2c
23 changed files with 394 additions and 291 deletions

View File

@@ -0,0 +1,57 @@
{ lib
, pkgs
, localPackages
, config
, ...
}:
with lib; let
cfg = config.simmer.networking;
in
{
options.simmer.networking = {
firewall = {
enable = mkOption {
description = "Whether to enable firewall";
type = types.bool;
default = true;
};
allowedTCPPorts = mkOption {
description = "Which tcp ports to allow through firewall";
type = types.listOf types.int;
default = [];
};
allowedUDPPorts = mkOption {
description = "Which udp ports to allow through firewall";
type = types.listOf types.int;
default = [];
};
};
wireguard = {
enable = mkOption {
description = "Whether to install wireguard";
type = types.bool;
default = false;
};
};
networkmanager = {
enable = mkOption {
description = "Whether to enable network manager";
type = types.bool;
default = true;
};
};
nameservers = mkOption {
description = "Which nameservers to use";
type = types.listOf types.str;
default = [ "1.1.1.1" ];
};
};
}