cinnamon.nemo: Fix open as root

Open as root support is added in src/nemo-view.c as `pkexec nemo`.
This does not match the full path in `org.nemo.root.policy` so it
doesn't work.

Replacing with `/run/current-system/sw/bin/nemo` seems to be the
easiest solution here, otherwise to properly support nemo-with-extensions,
we likely need to patch everything that calls `pkexec nemo` to accept
external environment variables for nemo path, and pass the path via
wrapper, and we still need to substitute `org.nemo.root.policy` in
nemo-with-extensions.
This commit is contained in:
Bobby Rong 2024-03-22 00:13:39 +08:00
parent b06025f153
commit 8eefcdc9e9
No known key found for this signature in database
1 changed files with 7 additions and 0 deletions

View File

@ -67,6 +67,13 @@ stdenv.mkDerivation rec {
"--localedir=${cinnamon-translations}/share/locale"
];
postInstall = ''
# This fixes open as root and handles nemo-with-extensions well.
# https://github.com/NixOS/nixpkgs/issues/297570
substituteInPlace $out/share/polkit-1/actions/org.nemo.root.policy \
--replace-fail "$out/bin/nemo" "/run/current-system/sw/bin/nemo"
'';
preFixup = ''
# Used for some non-fd.o icons (e.g. xapp-text-case-symbolic)
gappsWrapperArgs+=(