mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-13 18:57:37 +00:00
networkmanager: add withSystemd option
This commit is contained in:
parent
f5f7da678b
commit
ad9cfa229d
@ -6,7 +6,6 @@
|
||||
, pkg-config
|
||||
, dbus
|
||||
, gnome
|
||||
, systemd
|
||||
, libuuid
|
||||
, polkit
|
||||
, gnutls
|
||||
@ -51,6 +50,9 @@
|
||||
, runtimeShell
|
||||
, buildPackages
|
||||
, nixosTests
|
||||
, systemd
|
||||
, udev
|
||||
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
|
||||
}:
|
||||
|
||||
let
|
||||
@ -74,7 +76,8 @@ stdenv.mkDerivation rec {
|
||||
# System paths
|
||||
"--sysconfdir=/etc"
|
||||
"--localstatedir=/var"
|
||||
"-Dsystemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
|
||||
(lib.mesonOption "systemdsystemunitdir"
|
||||
(if withSystemd then "${placeholder "out"}/etc/systemd/system" else "no"))
|
||||
# to enable link-local connections
|
||||
"-Dudev_dir=${placeholder "out"}/lib/udev"
|
||||
"-Ddbus_conf_dir=${placeholder "out"}/share/dbus-1/system.d"
|
||||
@ -82,7 +85,8 @@ stdenv.mkDerivation rec {
|
||||
|
||||
# Platform
|
||||
"-Dmodprobe=${kmod}/bin/modprobe"
|
||||
"-Dsession_tracking=systemd"
|
||||
(lib.mesonOption "session_tracking" (if withSystemd then "systemd" else "no"))
|
||||
(lib.mesonBool "systemd_journal" withSystemd)
|
||||
"-Dlibaudit=yes-disabled-by-default"
|
||||
"-Dpolkit_agent_helper_1=/run/wrappers/bin/polkit-agent-helper-1"
|
||||
|
||||
@ -130,7 +134,7 @@ stdenv.mkDerivation rec {
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
systemd
|
||||
(if withSystemd then systemd else udev)
|
||||
libselinux
|
||||
audit
|
||||
libpsl
|
||||
@ -182,6 +186,9 @@ stdenv.mkDerivation rec {
|
||||
# TODO: submit upstream
|
||||
substituteInPlace meson.build \
|
||||
--replace "'vala', req" "'vala', native: false, req"
|
||||
'' + lib.optionalString withSystemd ''
|
||||
substituteInPlace data/NetworkManager.service.in \
|
||||
--replace-fail /usr/bin/busctl ${systemd}/bin/busctl
|
||||
'';
|
||||
|
||||
preBuild = ''
|
||||
|
@ -10,19 +10,6 @@ index 148acade5c..6395fbfbe5 100644
|
||||
+PROGRAM="@runtimeShell@ -c '@ethtool@/bin/ethtool -i $$1 |@gnused@/bin/sed -n s/^driver:\ //p' -- $env{INTERFACE}", ENV{ID_NET_DRIVER}="%c"
|
||||
|
||||
LABEL="nm_drivers_end"
|
||||
diff --git a/data/NetworkManager.service.in b/data/NetworkManager.service.in
|
||||
index f09ae86ceb..b2ecb405ef 100644
|
||||
--- a/data/NetworkManager.service.in
|
||||
+++ b/data/NetworkManager.service.in
|
||||
@@ -9,7 +9,7 @@ BindsTo=dbus.service
|
||||
[Service]
|
||||
Type=dbus
|
||||
BusName=org.freedesktop.NetworkManager
|
||||
-ExecReload=/usr/bin/busctl call org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager Reload u 0
|
||||
+ExecReload=@systemd@/bin/busctl call org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager Reload u 0
|
||||
#ExecReload=/bin/kill -HUP $MAINPID
|
||||
ExecStart=@sbindir@/NetworkManager --no-daemon
|
||||
Restart=on-failure
|
||||
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c
|
||||
index a9e8c08508..875d6cc2cd 100644
|
||||
--- a/src/core/devices/nm-device.c
|
||||
|
Loading…
Reference in New Issue
Block a user