Packaging Agordejo: Qt: Session management error: Could not open network socket

Hello,

I’m trying to compile and run Agordejo. It compiles fine, but when I run it, I get an error:

$ ./result/bin/agordejo 
Qt: Session management error: Could not open network socket

I tried to run before export -n SESSION_MANAGER, the error diseapear, but then the program just stop working… Any idea how I could finish to package Agordejo?

Thanks!

default.nix contains:

{ pkgs ? import <nixpkgs> {} }:
pkgs.qt5.callPackage ./derivation.nix {}

derivation.nix contains (compilation with nix-build):

{ mkDerivation, lib, stdenv, fetchurl, non, bash, autoPatchelfHook, python3, wrapGAppsHook }:

mkDerivation rec {
  version = "0.2.1";
  pname = "Agordejo";

  src = fetchurl {
    url = "https://git.laborejo.org/lss/Agordejo/archive/v${version}.tar.gz";
    sha256 = "fbutWVn0AkBfYCugRAypeR8LLKRlDkxIpMkGLWmBHT8=";
  };

  nativeBuildInputs = [ autoPatchelfHook wrapGAppsHook ];
  propagatedBuildInputs = [ non (python3.withPackages (ps: with ps; [pyqt5])) ];


  preConfigure = ''
    patchShebangs ./configure
  '';

  meta = {
    # description = "";
    # homepage = https://;
    # license = stdenv.lib.licenses.;
    # maintainers = [ stdenv.lib.maintainers. ];
    # platforms = stdenv.lib.platforms.;
  };
}

hi. I was looking for the same software and also couln’t make it work. I was trying to follow the wiki(s) advice with wrapQtAppsHook. This installs but gives me that error:

[I] ➜ agordejo
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

It’s mentioned here but I couldn’t figure it out.
https://nixos.wiki/wiki/Qt

{ stdenv, lib, libsForQt5, qt5, autoPatchelfHook, python3, wrapGAppsHook, fetchurl }:

qt5.mkDerivation {
  version = "0.3.0";
  pname = "agordejo";

  src = fetchurl {
    url = "https://git.laborejo.org/lss/Agordejo/archive/v0.3.0.tar.gz";
    sha256 = "54245acc0af3b99cb04313fc0f533cbc7921fb1d39e45d8a542b57188b4bb485";
  };

  buildInputs = [ qt5.qtbase ];
  nativeBuildInputs = [ autoPatchelfHook wrapGAppsHook qt5.wrapQtAppsHook ];
  propagatedBuildInputs = [ (python3.withPackages (ps: with ps; [pyqt5])) ];


  preConfigure = ''
    patchShebangs ./configure
  '';

  meta = {};
}

EDIT:
I’m using this from home manager with callPackage ./agordejo.nix { }. I don’t really get why some things have different “namespaces” in here than in the docs.