diff options
Diffstat (limited to 'infra/libkookie/modules/workstation/net')
-rw-r--r-- | infra/libkookie/modules/workstation/net/core.nix | 11 | ||||
-rw-r--r-- | infra/libkookie/modules/workstation/net/default.nix | 53 |
2 files changed, 64 insertions, 0 deletions
diff --git a/infra/libkookie/modules/workstation/net/core.nix b/infra/libkookie/modules/workstation/net/core.nix new file mode 100644 index 000000000000..2b6f37f32064 --- /dev/null +++ b/infra/libkookie/modules/workstation/net/core.nix @@ -0,0 +1,11 @@ +{ config, lib, ... }: + +let cfg = config.libkookie.workstation.net; +in +{ + networking.hostName = cfg.hostname; + networking.hostId = cfg.id; + + networking.networkmanager.enable = cfg.networkmanager; + networking.firewall.enable = cfg.firewall; +} diff --git a/infra/libkookie/modules/workstation/net/default.nix b/infra/libkookie/modules/workstation/net/default.nix new file mode 100644 index 000000000000..8f5c08ed9689 --- /dev/null +++ b/infra/libkookie/modules/workstation/net/default.nix @@ -0,0 +1,53 @@ +{ config, lib, pkgs, ... } @ args: + +let cfg = config.libkookie.workstation.net; +in +with lib; +{ + options.libkookie.workstation.net = { + enable = mkEnableOption "workstation network handling"; + + networkmanager = mkEnableOption "networkmanager system module"; + + firewall = mkOption { + type = types.bool; + default = true; + description = "system firewall"; + }; + + hostname = mkOption { + type = types.str; + description = "Networking hostname"; + }; + + id = mkOption { + type = types.str; + description = "Hash ID used for this networking node"; + }; + + randomMAC = let + type = with types; (submodule { + enable = mkEnableOption "MAC address randomisation"; + mask = mkOption { + type = str; + description = "MAC net mask to use"; + }; + }); + in + mkOption { + inherit type; + default = { + enable = false; + mask = "FE:FF:FF:00:00:00"; + }; + description = '' + MAC address randomisation module. + + The default net mask is based on intel WiFi NICs, to line up + with the modules used in Thinkpads. + ''; + }; + }; + + config = mkIf cfg.enable (import ./core.nix args); +} |