firewalld: don't depend on nm-connection-editor

This commit is contained in:
Sizhe Zhao 2026-04-14 11:58:10 +08:00
commit 737356d7d9
No known key found for this signature in database
GPG key ID: ED1807251A7DA08F
2 changed files with 21 additions and 8 deletions

View file

@ -0,0 +1,19 @@
--- a/src/firewall-applet.in
+++ b/src/firewall-applet.in
@@ -59,14 +59,8 @@
NM_CONNECTION_EDITOR = ""
for binary in [
- "/usr/bin/systemsettings",
- "/bin/systemsettings",
- "/usr/bin/nm-connection-editor",
- "/bin/nm-connection-editor",
- "/usr/bin/kde5-nm-connection-editor",
- "/bin/kde5-nm-connection-editor",
- "/usr/bin/kde-nm-connection-editor",
- "/bin/kde-nm-connection-editor",
+ "/run/current-system/sw/bin/systemsettings",
+ "/run/current-system/sw/bin/nm-connection-editor",
]:
if os.path.exists(binary):
NM_CONNECTION_EDITOR = binary

View file

@ -12,14 +12,12 @@
intltool,
ipset,
iptables,
kdePackages,
kmod,
libnotify,
librsvg,
libxml2,
libxslt,
networkmanager,
networkmanagerapplet,
pkg-config,
python3,
qt6,
@ -63,7 +61,8 @@ stdenv.mkDerivation (finalAttrs: {
./specify-localedir.patch
./gettext-0.25.patch
];
]
++ lib.optional withGui ./nm-connection-editor.patch;
postPatch = ''
substituteInPlace config/xmlschema/check.sh \
@ -73,11 +72,6 @@ stdenv.mkDerivation (finalAttrs: {
substituteInPlace $file \
--replace-fail /usr "$out"
done
''
+ lib.optionalString withGui ''
substituteInPlace src/firewall-applet.in \
--replace-fail "/usr/bin/systemsettings" "${kdePackages.systemsettings}/bin/systemsettings" \
--replace-fail "/usr/bin/nm-connection-editor" "${networkmanagerapplet}/bin/nm-connection-editor"
'';
nativeBuildInputs = [