about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorAndreas Rammhold <andreas@rammhold.de>2019-05-09 14:13:26 +0200
committerAndreas Rammhold <andreas@rammhold.de>2019-06-03 15:05:12 +0200
commit1f03f6fc43a6f71b8204adf6cd02fb3685261add (patch)
tree414ee9fa170426c2abf9f5c1c32f0749add5ddbf /nixos/modules
parent8c7e588362e708ade5e782c09dbdf84d06ab4254 (diff)
downloadnixlib-1f03f6fc43a6f71b8204adf6cd02fb3685261add.tar
nixlib-1f03f6fc43a6f71b8204adf6cd02fb3685261add.tar.gz
nixlib-1f03f6fc43a6f71b8204adf6cd02fb3685261add.tar.bz2
nixlib-1f03f6fc43a6f71b8204adf6cd02fb3685261add.tar.lz
nixlib-1f03f6fc43a6f71b8204adf6cd02fb3685261add.tar.xz
nixlib-1f03f6fc43a6f71b8204adf6cd02fb3685261add.tar.zst
nixlib-1f03f6fc43a6f71b8204adf6cd02fb3685261add.zip
nixos/udev: switch `networking.usePredicatableInterfaceNames` to a kernel param
The udev rules we are shipping no longer work with systemd v242 and were
remove upstream some time ago. It seems like the entire renaming is now
done in C and not in the udev rules.
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/services/hardware/80-net-setup-link.rules13
-rw-r--r--nixos/modules/services/hardware/udev.nix6
2 files changed, 2 insertions, 17 deletions
diff --git a/nixos/modules/services/hardware/80-net-setup-link.rules b/nixos/modules/services/hardware/80-net-setup-link.rules
deleted file mode 100644
index 18547f170a3f..000000000000
--- a/nixos/modules/services/hardware/80-net-setup-link.rules
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copied from systemd 203.
-ACTION=="remove", GOTO="net_name_slot_end"
-SUBSYSTEM!="net", GOTO="net_name_slot_end"
-NAME!="", GOTO="net_name_slot_end"
-
-IMPORT{cmdline}="net.ifnames"
-ENV{net.ifnames}=="0", GOTO="net_name_slot_end"
-
-NAME=="", ENV{ID_NET_NAME_ONBOARD}!="", NAME="$env{ID_NET_NAME_ONBOARD}"
-NAME=="", ENV{ID_NET_NAME_SLOT}!="", NAME="$env{ID_NET_NAME_SLOT}"
-NAME=="", ENV{ID_NET_NAME_PATH}!="", NAME="$env{ID_NET_NAME_PATH}"
-
-LABEL="net_name_slot_end"
diff --git a/nixos/modules/services/hardware/udev.nix b/nixos/modules/services/hardware/udev.nix
index 0266286aaacf..cb2f1e6621ae 100644
--- a/nixos/modules/services/hardware/udev.nix
+++ b/nixos/modules/services/hardware/udev.nix
@@ -116,10 +116,6 @@ let
         exit 1
       fi
 
-      ${optionalString config.networking.usePredictableInterfaceNames ''
-        cp ${./80-net-setup-link.rules} $out/80-net-setup-link.rules
-      ''}
-
       # If auto-configuration is disabled, then remove
       # udev's 80-drivers.rules file, which contains rules for
       # automatically calling modprobe.
@@ -282,6 +278,8 @@ in
 
     services.udev.path = [ pkgs.coreutils pkgs.gnused pkgs.gnugrep pkgs.utillinux udev ];
 
+    boot.kernelParams = mkIf (!config.networking.usePredictableInterfaceNames) [ "net.ifnames=0" ];
+
     environment.etc =
       [ { source = udevRules;
           target = "udev/rules.d";