3
0
Fork 0
forked from mirrors/nixpkgs

NetworkManager: Fix aliases and dependencies

There are two fixes in this commit.

Firstly, I am creating proper symlinks for the Alias= definitions in the
.service files. This achieves the same result as `systemctl enable`, and
I think is preferred over `mv`.

Secondly, `networkmanager-init` now wants `NetworkManager.service`,
along with `ModemManager.service`. ModemManager does not depend on
NetworkManager (according to `systemctl list-dependencies ModemManager`),
thus NetworkManager never got started on boot.
This commit is contained in:
Oliver Charles 2014-02-12 11:29:18 +00:00
parent 7271eb50e6
commit 625b42838a
2 changed files with 7 additions and 5 deletions

View file

@ -178,7 +178,7 @@ in {
description = "NetworkManager initialisation";
wantedBy = [ "network.target" ];
partOf = [ "NetworkManager.service" ];
wants = [ "ModemManager.service" ];
wants = [ "ModemManager.service" "NetworkManager.service" ];
before = [ "NetworkManager.service" ];
script = ''
mkdir -m 700 -p /etc/NetworkManager/system-connections

View file

@ -61,8 +61,10 @@ stdenv.mkDerivation rec {
# FIXME: Workaround until NixOS' dbus+systemd supports at_console policy
substituteInPlace $out/etc/dbus-1/system.d/org.freedesktop.NetworkManager.conf --replace 'at_console="true"' 'group="networkmanager"'
# As NixOS doesn't seem to handle systemd Aliases, we just rename the dispatcher service file
mv $out/etc/systemd/system/NetworkManager-dispatcher.service $out/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service
# systemd in NixOS doesn't use `systemctl enable`, so we need to establish
# aliases ourselves.
ln -s $out/etc/systemd/system/NetworkManager-dispatcher.service $out/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service
ln -s $out/etc/systemd/system/NetworkManager.service $out/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service
'';
meta = with stdenv.lib; {