nixpkgs/pkgs/tools/networking/modem-manager/default.nix
Will Dietz 447d625edc 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.
2019-09-14 08:05:27 -04:00

43 lines
1.3 KiB
Nix

{ stdenv, fetchurl, glib, udev, libgudev, polkit, ppp, gettext, pkgconfig
, libmbim, libqmi, systemd, vala, gobject-introspection, dbus }:
stdenv.mkDerivation rec {
pname = "modem-manager";
version = "1.10.0";
package = "ModemManager";
src = fetchurl {
url = "https://www.freedesktop.org/software/${package}/${package}-${version}.tar.xz";
sha256 = "1qkfnxqvaraz1npahqvm5xc73mbxxic8msnsjmlwkni5c2ckj3zx";
};
nativeBuildInputs = [ vala gobject-introspection gettext pkgconfig ];
buildInputs = [ glib udev libgudev polkit ppp libmbim libqmi systemd ];
configureFlags = [
"--with-polkit"
"--with-udev-base-dir=${placeholder "out"}/lib/udev"
"--with-dbus-sys-dir=${placeholder "out"}/etc/dbus-1/system.d"
"--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
"--sysconfdir=/etc"
"--localstatedir=/var"
"--with-systemd-suspend-resume"
"--with-systemd-journal"
];
preCheck = ''
export G_TEST_DBUS_DAEMON="${dbus.daemon}/bin/dbus-daemon"
'';
doCheck = true;
meta = with stdenv.lib; {
description = "WWAN modem manager, part of NetworkManager";
homepage = https://www.freedesktop.org/wiki/Software/ModemManager/;
license = licenses.gpl2Plus;
maintainers = [ ];
platforms = platforms.linux;
};
}