aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/modules/workstation/net/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'infra/libkookie/modules/workstation/net/default.nix')
-rw-r--r--infra/libkookie/modules/workstation/net/default.nix53
1 files changed, 53 insertions, 0 deletions
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);
+}