about summary refs log tree commit diff
path: root/nixos/modules/services/networking/networkmanager.nix
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2019-09-13 11:11:53 -0500
committerWill Dietz <w@wdtz.org>2019-09-13 21:02:39 -0500
commitf99bdb2b615da434e0f2814a5924a2aa6a7a1f66 (patch)
tree4aaaa32cf4ee3720dd9fb77b91a42a36ad61175c /nixos/modules/services/networking/networkmanager.nix
parenta412701c8de181777558677b16be0bfed6eba519 (diff)
downloadnixlib-f99bdb2b615da434e0f2814a5924a2aa6a7a1f66.tar
nixlib-f99bdb2b615da434e0f2814a5924a2aa6a7a1f66.tar.gz
nixlib-f99bdb2b615da434e0f2814a5924a2aa6a7a1f66.tar.bz2
nixlib-f99bdb2b615da434e0f2814a5924a2aa6a7a1f66.tar.lz
nixlib-f99bdb2b615da434e0f2814a5924a2aa6a7a1f66.tar.xz
nixlib-f99bdb2b615da434e0f2814a5924a2aa6a7a1f66.tar.zst
nixlib-f99bdb2b615da434e0f2814a5924a2aa6a7a1f66.zip
networkmanager,modemmanager: fix service symlinks for systemd v243
Fixes problems such as:

systemd[1]: Failed to put bus name to hashmap: File exists
systemd[1]: dbus-org.freedesktop.nm-dispatcher.service: Two services allocated for the same bus name org.freedesktop.nm_dispatcher, refusing operation.

Problem is that systemd treats symlinks to files outside the service
path differently, causing our old workaround to look like two separate services.

These symlinks are intended to be a means for manually emulating
the behavior of the `Alias=` directive in these services.
Unfortunately even making these symlinks relative isn't enough,
since they don't make it to where it matters--
that only makes the links in /etc/static/systemd/system/*
relative, with systemd still being shown non-relative links
in /etc/systemd/system/*.

To fix this, drop all of this at the package level
and instead simply specify the aliases in the NixOS modules.

Also handle the same for modemmanager,
since the networkmanager NixOS module also handles that.
Diffstat (limited to 'nixos/modules/services/networking/networkmanager.nix')
-rw-r--r--nixos/modules/services/networking/networkmanager.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/nixos/modules/services/networking/networkmanager.nix b/nixos/modules/services/networking/networkmanager.nix
index db4d0e328e2d..db047e6d0b89 100644
--- a/nixos/modules/services/networking/networkmanager.nix
+++ b/nixos/modules/services/networking/networkmanager.nix
@@ -468,12 +468,16 @@ in {
         mkdir -m 700 -p /etc/ipsec.d
         mkdir -m 755 -p ${stateDirs}
       '';
+
+      aliases = [ "dbus-org.freedesktop.NetworkManager.service" ];
     };
 
     systemd.services.NetworkManager-wait-online = {
       wantedBy = [ "network-online.target" ];
     };
 
+    systemd.services.ModemManager.aliases = [ "dbus-org.freedesktop.ModemManager1.service" ];
+
     systemd.services.nm-setup-hostsdirs = mkIf dynamicHostsEnabled {
       wantedBy = [ "NetworkManager.service" ];
       before = [ "NetworkManager.service" ];
@@ -495,6 +499,7 @@ in {
 
       # useful binaries for user-specified hooks
       path = [ pkgs.iproute pkgs.utillinux pkgs.coreutils ];
+      aliases = [ "dbus-org.freedesktop.nm-dispatcher.service" ];
     };
 
     # Turn off NixOS' network management when networking is managed entirely by NetworkManager