kando icon indicating copy to clipboard operation
kando copied to clipboard

Kwin version check fails on NixOS

Open Hex-4 opened this issue 1 year ago • 14 comments

Short Summary

Kando fails to start on NixOS Plasma 6 (wayland) with the error Kando failed to start: Command failed: kwin_wayland --version, but kwin_wayland --version works

Steps to Reproduce the Issue

  1. Add the Kando 1.2.0 AppImage to your home-manager configuration with
    (pkgs.appimageTools.wrapType2 { # or wrapType1
      name = "kando";
      src = pkgs.fetchurl {
        url = "https://github.com/kando-menu/kando/releases/download/v1.2.0/Kando-1.2.0-x86_64.AppImage";
        hash = "sha256-kaxl9ffnOcjfONmI+lNt+NUkaD2N4wMfo/s72T7yL/M=";
      };
      extraPkgs = pkgs: with pkgs; [ ];
    })
  1. Rebuild system
  2. Run Kando with kando

Kando Version

1.2.0

Installation Method

Another method (specify in the comments below)

Desktop Environment

KDE on Wayland

Environment Version

KDE Plasma 6.1 on NixOS unstable (24.11)

Additional Information

Installed by adding AppImage to home-manager config. When I run the portable executable with steam-run ./kando after unzipping I get the same error. Possibly related to #359.

Hex-4 avatar Jul 20 '24 16:07 Hex-4

On my Arch-based EndeavorOS, this executable is located in /usr/bin. Is that the same for you?

@ivan-hc @Samueru-sama Sorry to ping you, but are you aware of any reason why an app in an AppImage may not be able to call a binary which is available in the outer shell? Can this be some $PATH issues? Or is there anything else going on which could cause this?

Schneegans avatar Jul 20 '24 17:07 Schneegans

@Hex-4 try to run kando like this

GDK_BACKEND=x11 kando

ivan-hc avatar Jul 20 '24 18:07 ivan-hc

On my Arch-based EndeavorOS, this executable is located in /usr/bin. Is that the same for you?

NixOS does not use the FHS standard:

which kwin_wayland /run/wrappers/bin/kwin_wayland

Zetaphor avatar Jul 20 '24 19:07 Zetaphor

try to run kando like this:

Same error.

$ GDK_BACKEND=x11 kando
Running on Linux (KDE on wayland).
Loading settings from /home/hexatron/.config/kando/config.json
Loading settings from /home/hexatron/.config/kando/menus.json
Kando failed to start: Command failed: kwin_wayland --version
failed to inherit capabilities: Operation not permitted

Hex-4 avatar Jul 20 '24 19:07 Hex-4

@Hex-4 Maybe try with buldFHSEnv in your package script?

Zetaphor avatar Jul 20 '24 19:07 Zetaphor

I think wrapType2 does that already.

https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-appimageTools

Hex-4 avatar Jul 20 '24 20:07 Hex-4

Do you have this issue when running other electron appimages in nix?

Samueru-sama avatar Jul 21 '24 00:07 Samueru-sama

The Obsidian (which uses Electron) AppImage runs just fine.

Hex-4 avatar Jul 21 '24 00:07 Hex-4

The Obsidian AppRun contains this line:

export LD_LIBRARY_PATH="${APPDIR}/usr/lib:${LD_LIBRARY_PATH}"

And in that location the following libraries were added:

libappindicator.so.1
libgconf-2.so.4
libindicator.so.7
libnotify.so.4
libXss.so.1
libXtst.so.6

Can you try this appimage in nix? that one doesn't contain said libraries.

Samueru-sama avatar Jul 21 '24 01:07 Samueru-sama

That one works.

Hex-4 avatar Jul 21 '24 20:07 Hex-4

Can it be that /run/wrappers/bin is not in the search path when Kando is run from the AppImage?

Schneegans avatar Jul 22 '24 06:07 Schneegans

It looks like another place that kwin_wayland is located in is /run/current-system/sw/bin/kwin_wayland

Naitrate avatar Aug 24 '24 14:08 Naitrate

Well, maybe /run/current-system/sw/bin/ or /run/wrappers/bin needs to be added to the PATH? Could anybody try to build the appimage on NixOS and modify the script before so that the paths are added to the PATH before running Kando?

I guess that an export PATH=$PATH:/run/current-system/sw/bin/:/run/wrappers/bin before this line could be sufficient.

git clone https://github.com/kando-menu/kando.git
cd kando
npm install
npm run package
tools/make-app-image.sh

The app image should then be in out/make/appimage.

Schneegans avatar Aug 24 '24 18:08 Schneegans

Well, maybe /run/current-system/sw/bin/ or /run/wrappers/bin needs to be added to the PATH? Could anybody try to build the appimage on NixOS and modify the script before so that the paths are added to the PATH before running Kando?

I guess that an export PATH=$PATH:/run/current-system/sw/bin/:/run/wrappers/bin before this line could be sufficient.

git clone https://github.com/kando-menu/kando.git
cd kando
npm install
npm run package
tools/make-app-image.sh

The app image should then be in out/make/appimage.

I tried that while attempting to compile the application in a Fedora distrobox (Because Nix doesn't use traditional building methods for packages, and there's already a ticket saying that compiling it on Nix itself is challenging), and I didn't have much success building the package.

There's a issue ticket on Nixpkgs here.

I tried running the path command before running the regular AppImage in the releases section, and it still results in the same thing happening.

Naitrate avatar Aug 25 '24 14:08 Naitrate

Kando is now available as a Nix package: https://search.nixos.org/packages?channel=unstable&show=kando

Does this work for you?

Schneegans avatar Nov 01 '24 09:11 Schneegans

Yep, it works! Looks like the package does some dependency patching and builds directly from source.

Thanks for the help!

Hex-4 avatar Nov 01 '24 18:11 Hex-4