aboutsummaryrefslogtreecommitdiff
path: root/nixos
diff options
context:
space:
mode:
authorWill Dietz <w@wdtz.org>2019-09-13 11:11:53 -0500
committerworldofpeace <worldofpeace@protonmail.ch>2019-09-14 08:05:27 -0400
commit447d625edc3a488deee1c9b2e5890dd974e55ee3 (patch)
treed343b9f5d9dbfbea13dd2f7275f0f8ef3bdd4b49 /nixos
parent8b34d843c6f24168787cad90912e0fa20d11d6d5 (diff)
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')
-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 2061c02fffb..bef0ff36567 100644
--- a/nixos/modules/services/networking/networkmanager.nix
+++ b/nixos/modules/services/networking/networkmanager.nix
@@ -462,12 +462,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" ];
@@ -489,6 +493,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