Czkawka - build from master workaround?

I’m using the application “czkawka” for file management a lot and since switching to NixOS I’ve been hit by this bug:

The author says to workaround we either need to use the master branch or downgrade to GTK version lower than 4.20

Is there some easy to understand and follow guide or template for integrating that as a self managed nix package someone could point me to? Or is the suggested path for NixOS newbies rather to just build it inside a home-subfolder and call the binary with it’s path?

UPDATE: I just saw @qarmin also suggests switching to a differnt also included gui = “krokiet” - but that fails to start on my NixOS installation:

08:55:17.509 [INFO] czkawka_core::common::logger: Logging to file "/home/user/.cache/czkawka/krokiet.log" and terminal
08:55:17.515 [INFO] czkawka_core::common::logger: Krokiet version: 10.0.0, release mode, rust 1.91.1 (2025-11-07), os NixOS 25.11.0 (x86_64 64-bit), 20 cpu/threads, features(0): [], app cpu version: x86-64-v1 (SSE2), os cpu version: x86-64-v3 (AVX2)
08:55:17.515 [INFO] czkawka_core::common::config_cache_path: Config folder set to "/home/user/.config/krokiet" and cache folder set to "/home/user/.cache/czkawka"
08:55:17.515 [INFO] krokiet: Krokiet features(2): [winit_femtovg, winit_software]
08:55:17.524 [ERROR] log_panics: thread 'main' panicked at 'Failed to create main window: Could not initialize backend.
Error from Winit backend: Error initializing winit event loop: os error at /build/czkawka-10.0.0-vendor/winit-0.30.12/src/platform_impl/linux/wayland/event_loop/mod.rs:89: The wayland library could not be loaded
No backends configured.': krokiet/src/main.rs:77
   0: log_panics::Config::install_panic_hook::{{closure}}
   1: std::panicking::panic_with_hook
   2: std::panicking::panic_handler::{{closure}}
   3: std::sys::backtrace::__rust_end_short_backtrace
   4: __rustc::rust_begin_unwind
   5: core::panicking::panic_fmt
   6: core::result::unwrap_failed
   7: krokiet::main
   8: std::sys::backtrace::__rust_begin_short_backtrace
   9: std::rt::lang_start::{{closure}}
  10: std::rt::lang_start_internal
  11: main
  12: __libc_start_call_main
  13: __libc_start_main_alias_1
  14: _start

maybe somebody here can help with that?

UPDATE2: for the first workaround idea (building from master) this seems very related, but very difficult to understand for a non-NixOS-expert..

For the idea to switch to the newer GUI “krokiet” the software’s author @qarmin said it’s probably a packaging problem on NixOS and gave those links as explanations..:

UPDATE3:
It seems the NixOS build script for czkawka needs to be adapted similarly to what was done here:

does anybody know how I could get in contact with the maintainer of the NixOS czkawka package?

Have you tried contacting via email? The NixOS Search gives you a nice mailto: with all maintainers of the package.

The other option would be to open an issue and ping them?

1 Like

no I didn’t, since I didn’t know about it. Thanks about that hint where to find who the maintainers are:
@yanganto @0x4A6F → do you have accounts here in discourse? can you help me?

Maybe the ux is not that clear, but if you click on the package czkawkathe package details are shown. Those include several links and a list of the maintainers with the option to mail them all :mouse_trap:

1 Like

I’ve added a modified copy of the czkawka.nix package definition to my /etc/nixos/config*.nix setup:

{
  lib,
  atk,
  cairo,
  callPackage,
  fetchFromGitHub,
  gdk-pixbuf,
  glib,
  gobject-introspection,
  gtk4,
  pango,
  libGL,
  wayland,
  pkg-config,
  rustPlatform,
  stdenv,
  testers,
  wrapGAppsHook4,
  xvfb-run,
  versionCheckHook,
}:

let
  self = rustPlatform.buildRustPackage {
    pname = "czkawka";
    version = "10.0.0+";

    src = fetchFromGitHub {
      owner = "qarmin";
      repo = "czkawka";
      rev = "420d044b74c2472f9067ef64ca6763214ca14715";
      hash = "sha256-j2O9mBsujjdS/gsD3p8Lcry9qYu/SkJf+fttNT/hjQA=";
    };

    cargoHash = "sha256-6ZfHUnGmnOJ8k2uieiZ3SCvpQ4H47DAuvPas1KaTeg0=";

    nativeBuildInputs = [
      gobject-introspection
      pkg-config
      wrapGAppsHook4
    ];

    buildInputs = [
      atk
      cairo
      gdk-pixbuf
      glib
      gtk4
      pango
      libGL
      wayland
    ];

    nativeCheckInputs = [ xvfb-run ];

    strictDeps = true;

    doCheck = stdenv.hostPlatform.isLinux && (stdenv.hostPlatform == stdenv.buildPlatform);

    checkPhase = ''
      runHook preCheck
      xvfb-run cargo test
      runHook postCheck
    '';

    # Desktop items, icons and metainfo are not installed automatically
    postInstall = ''
      install -Dm444 -t $out/share/applications data/com.github.qarmin.czkawka.desktop
      install -Dm444 -t $out/share/icons/hicolor/scalable/apps data/icons/com.github.qarmin.czkawka.svg
      install -Dm444 -t $out/share/icons/hicolor/scalable/apps data/icons/com.github.qarmin.czkawka-symbolic.svg
      install -Dm444 -t $out/share/metainfo data/com.github.qarmin.czkawka.metainfo.xml
    '';

    nativeInstallCheckInputs = [
      versionCheckHook
    ];
    versionCheckProgram = "${placeholder "out"}/bin/czkawka_cli";
    versionCheckProgramArg = "--version";
    doInstallCheck = false;

    passthru = {
      tests.version = testers.testVersion {
        package = self;
        command = "czkawka_cli --version";
      };
      wrapper = callPackage ./wrapper.nix {
        czkawka = self;
      };
    };

    meta = {
      homepage = "https://github.com/qarmin/czkawka";
      description = "Simple, fast and easy to use app to remove unnecessary files from your computer";
      changelog = "https://github.com/qarmin/czkawka/raw/${self.version}/Changelog.md";
      license = with lib.licenses; [ mit ];
      mainProgram = "czkawka_gui";
      maintainers = with lib.maintainers; [
        yanganto
        _0x4A6F
      ];
    };
  };
in
self

That suffices to fix the czkawka_gui component (does no longer freeze when deleting files), but krokiet still fails to start, even though I added wayland to the dependency list:

Error from Winit backend: Error initializing winit event loop: os error at /build/czkawka-10.0.0+-vendor/winit-0.30.12/src/platform_impl/linux/wayland/event_loop/mod.rs:89: The wayland library could not be loaded