Unverified Commit 8eefcdc9 authored by Bobby Rong's avatar Bobby Rong
Browse files

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.
parent b06025f1
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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+=(