refactor: networkmanager: use substitute
instead of sed
when patching
This commit is contained in:
@@ -6,8 +6,9 @@ in
|
|||||||
sane.programs.modemmanager = {
|
sane.programs.modemmanager = {
|
||||||
packageUnwrapped = pkgs.modemmanager-split.daemon.overrideAttrs (upstream: {
|
packageUnwrapped = pkgs.modemmanager-split.daemon.overrideAttrs (upstream: {
|
||||||
postInstall = (upstream.postInstall or "") + ''
|
postInstall = (upstream.postInstall or "") + ''
|
||||||
sed 's/"root"/"networkmanager"/g' $out/share/dbus-1/system.d/org.freedesktop.ModemManager1.conf \
|
substitute $out/share/dbus-1/system.d/org.freedesktop.ModemManager1.conf \
|
||||||
> $out/share/dbus-1/system.d/networkmanager-org.freedesktop.ModemManager1.conf
|
$out/share/dbus-1/system.d/networkmanager-org.freedesktop.ModemManager1.conf \
|
||||||
|
--replace-fail 'user="root"' 'group="networkmanager"'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = upstream.meta // {
|
meta = upstream.meta // {
|
||||||
|
@@ -19,9 +19,12 @@ in
|
|||||||
# '';
|
# '';
|
||||||
postInstall = (upstream.postInstall or "") + ''
|
postInstall = (upstream.postInstall or "") + ''
|
||||||
# allow the bus to owned by either root or networkmanager users
|
# allow the bus to owned by either root or networkmanager users
|
||||||
|
# use the group here, that way ordinary users can be elevated to control networkmanager
|
||||||
|
# (via e.g. `nmcli`)
|
||||||
for f in org.freedesktop.NetworkManager.conf nm-dispatcher.conf ; do
|
for f in org.freedesktop.NetworkManager.conf nm-dispatcher.conf ; do
|
||||||
sed 's/"root"/"networkmanager"/g' $out/share/dbus-1/system.d/$f \
|
substitute $out/share/dbus-1/system.d/$f \
|
||||||
> $out/share/dbus-1/system.d/networkmanager-$f
|
$out/share/dbus-1/system.d/networkmanager-$f \
|
||||||
|
--replace-fail 'user="root"' 'group="networkmanager"'
|
||||||
done
|
done
|
||||||
|
|
||||||
# remove unused services to prevent any unexpected interactions
|
# remove unused services to prevent any unexpected interactions
|
||||||
|
@@ -12,8 +12,9 @@ in
|
|||||||
# 'user="root"' 'user="networkmanager"'
|
# 'user="root"' 'user="networkmanager"'
|
||||||
# '';
|
# '';
|
||||||
postInstall = (upstream.postInstall or "") + ''
|
postInstall = (upstream.postInstall or "") + ''
|
||||||
sed 's/"root"/"networkmanager"/g' $out/share/dbus-1/system.d/dbus-wpa_supplicant.conf \
|
substitute $out/share/dbus-1/system.d/dbus-wpa_supplicant.conf \
|
||||||
> $out/share/dbus-1/system.d/networkmanager-wpa_supplicant.conf
|
$out/share/dbus-1/system.d/networkmanager-wpa_supplicant.conf \
|
||||||
|
--replace-fail 'user="root"' 'group="networkmanager"'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postFixup = (upstream.postFixup or "") + ''
|
postFixup = (upstream.postFixup or "") + ''
|
||||||
|
Reference in New Issue
Block a user