diff options
author | Linus Heckemann <git@sphalerite.org> | 2019-04-11 19:41:47 +0200 |
---|---|---|
committer | Linus Heckemann <git@sphalerite.org> | 2019-06-07 21:43:29 +0200 |
commit | 26317b02aeae3ae5f086f22822ccd9695df03bb8 (patch) | |
tree | ab27c919a0ad520473a8d08f9e210560b4595d91 /nixos/modules/tasks/network-interfaces.nix | |
parent | fef728b6ead201c1ddb812e2afb22ac372669e46 (diff) | |
download | nixpkgs-26317b02aeae3ae5f086f22822ccd9695df03bb8.tar nixpkgs-26317b02aeae3ae5f086f22822ccd9695df03bb8.tar.gz nixpkgs-26317b02aeae3ae5f086f22822ccd9695df03bb8.tar.bz2 nixpkgs-26317b02aeae3ae5f086f22822ccd9695df03bb8.tar.lz nixpkgs-26317b02aeae3ae5f086f22822ccd9695df03bb8.tar.xz nixpkgs-26317b02aeae3ae5f086f22822ccd9695df03bb8.tar.zst nixpkgs-26317b02aeae3ae5f086f22822ccd9695df03bb8.zip |
nixos/network-interfaces: always apply privacy extensions
Fixes #56306
Diffstat (limited to 'nixos/modules/tasks/network-interfaces.nix')
-rw-r--r-- | nixos/modules/tasks/network-interfaces.nix | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/nixos/modules/tasks/network-interfaces.nix b/nixos/modules/tasks/network-interfaces.nix index f9b0eb330bf..e14cafa9b12 100644 --- a/nixos/modules/tasks/network-interfaces.nix +++ b/nixos/modules/tasks/network-interfaces.nix @@ -1087,7 +1087,14 @@ in virtualisation.vswitch = mkIf (cfg.vswitches != { }) { enable = true; }; - services.udev.packages = mkIf (cfg.wlanInterfaces != {}) [ + services.udev.packages = [ + (pkgs.writeTextFile rec { + name = "99-ipv6-privacy-extensions.rules"; + destination = "/etc/udev/rules.d/99-${name}"; + text = '' + ACTION=="add", SUBSYSTEM=="net", RUN+="${pkgs.procps}/bin/sysctl net.ipv6.conf.%k.use_tempaddr=2" + ''; + }) ] ++ lib.optional (cfg.wlanInterfaces != {}) (pkgs.writeTextFile { name = "99-zzz-40-wlanInterfaces.rules"; destination = "/etc/udev/rules.d/99-zzz-40-wlanInterfaces.rules"; @@ -1161,8 +1168,7 @@ in # Generate the same systemd events for both 'add' and 'move' udev events. ACTION=="move", SUBSYSTEM=="net", ENV{DEVTYPE}=="wlan", NAME=="${device}", ${systemdAttrs curInterface._iName} ''); - }) ]; - + }); }; } |