From 86fb7036cb4279abfc4ffc2bfa6b3a432c8700b5 Mon Sep 17 00:00:00 2001 From: Tim Keller Date: Thu, 21 Aug 2025 12:27:51 -0500 Subject: refactor project to prioritize correctness. place custom nixos options into existing 'modules' and prefix them with '_'. use _archetypes module for software collections, system profiles, etc. personal configs moved to _archetypes.tjkeller. probably changed or fixed or broke a few other things in the process --- modules/root/net-iface-labels.nix | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 modules/root/net-iface-labels.nix (limited to 'modules/root/net-iface-labels.nix') diff --git a/modules/root/net-iface-labels.nix b/modules/root/net-iface-labels.nix deleted file mode 100644 index 4949659..0000000 --- a/modules/root/net-iface-labels.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ config, lib, ... }: let - validMac = str: builtins.match ''^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}$'' str != null; - macAddressType = lib.types.str // { - check = validMac; - description = "a mac address (xx:xx:xx:xx:xx:xx)"; - }; -in { - options.networking.interfaceLabels = { - enable = lib.mkEnableOption "manually label network interfaces"; - interfaces = lib.mkOption { - type = lib.types.attrsOf macAddressType; - default = {}; - example = { - "lan0" = "00:11:22:33:44:55"; - "lan1" = "66:77:88:99:AA:BB"; - }; - description = "label network interfaces by their mac address"; - }; - }; - - config = lib.mkIf config.networking.interfaceLabels.enable { - networking.usePredictableInterfaceNames = false; - services.udev.extraRules = lib.concatStringsSep "\n" ( - lib.mapAttrsToList (name: mac: ''ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="${mac}", NAME="${name}"'') config.networking.interfaceLabels.interfaces - ); - }; -} -- cgit v1.2.3