Trouble packaging LightlyShaders for Plasma Kwin Effect

So I have been trying to package a-parhom’s LightlyShaders for myself and then maybe try to get it into nixpkgs. The issue is, well, it’s not working. I can get it to build, and to install, but kwin believes that this is an unsupported effect. I can get it working on any other distro and if I nix-shell then build with the commands on the github page and do a kwin-x11 --replace, but that’s only for that session. As soon as I leave that nix-shell, it won’t work.

Here is what I have in the default.nix so far:

{
  stdenv,
  lib,
  fetchFromGitHub,
  qtbase,
  kwin,
  cmake,
  qt5Full,
  extra-cmake-modules,
  wrapQtAppsHook,
  libepoxy,
  kdelibs4support,
  libXdmcp
}:

stdenv.mkDerivation rec {
  pname = "LightlyShaders";
  version = "0.0.1";

  src = fetchFromGitHub {
    owner = "a-parhom";
    repo = "LightlyShaders";
    rev = "0294499afece1620f47fa38fa74fa8604077347f";
    sha256 = "8EL1e4YKY63U7kvqBLfqSzYHdls1BD6OYh4X5+B7EcQ=";
  };

  buildInputs = [
    qtbase
    kdelibs4support
    kwin
    libepoxy
    libXdmcp
  ];

  nativeBuildInputs = [
    cmake
    extra-cmake-modules
    wrapQtAppsHook
  ];

  # preConfigure = ''
  #   # local modulepath=$(kf5-config --install module)
  #   # local datapath=$(kf5-config --install data)
  #   # local servicespath=$(kf5-config --install services)
  #   # substituteInPlace CMakeLists.txt \
  #   #   --replace "\''${MODULEPATH}" "$out/''${modulepath#/nix/store/*/}" \
  #   #   --replace "\''${DATAPATH}"   "$out/''${datapath#/nix/store/*/}"

  #   # substituteInPlace CMakeLists.txt \
  #   #   --replace "\''${MODULEPATH}" "$out/qt-5.15.3/plugins" \
  #   #   --replace "\''${DATAPATH}"   "$out/share"
  # '';

  postConfigure = ''
    substituteInPlace cmake_install.cmake \
      --replace "${kdelibs4support}" "$out"

  '';

  meta = with lib; {
    name = "LightlyShaders";
    description = "Round corners and outline effect for KWin.";
    homepage = "https://github.com/a-parhom/LightlyShaders";
    license = licenses.gpl3;
    maintainers = [ "chriscochrun" ];
    platforms = platforms.all;
  };
}

Notice how I have a section of trying a few different things I’ve found throughout the internet. The postConfigure gets it installed to be seen by kwin in systemsettings, but only if you show unsupported kwin effects in the filter button of desktop effects.

The preConfigure piece I had in there that is commented out never actually got it installed either. It just wasn’t visible to kwin.

This is essentially the same default.nix that kde-rounded-corners uses here: nixpkgs/default.nix at 71c69919a0165df2fd336bdf15efc361d92a634c · NixOS/nixpkgs · GitHub

Anyone want to help me package this here fella?

sorry for bumping this old topic, but I have been able to use lightlyshaders using this (in case someone wants to use lightlyshaders) :

{ lib
, mkDerivation
, fetchFromGitHub
, cmake
, extra-cmake-modules
, kwindowsystem
, plasma-framework
, systemsettings
, kdecoration
, libsForQt5
, kwin
, libepoxy
, kdelibs4support
}:

mkDerivation rec {
  pname = "lightlyshaders";                                     
  version = "v2.0.0";                                           
                                                                
  src = fetchFromGitHub {                                       
    owner = "a-parhom";
    repo = pname;
    rev = "17fefe0b29de46c290f3cda02a34134918d45edf";
    sha256 = "sha256-5qir3NEYG8r+nECkztLRTTnI6Ivwd1CyYqhIGivlvJE=";                                                    
  };

  #cmakeFlags = [ ];

  nativeBuildInputs = [
    cmake
    extra-cmake-modules
  ];

  buildInputs = [
    kwindowsystem
    plasma-framework
    systemsettings
    kdecoration
    libsForQt5.kinit
    kwin
    libepoxy
    kdelibs4support
  ];

  postConfigure = ''
    substituteInPlace cmake_install.cmake \
      --replace "${kdelibs4support}" "$out"
  '';

  meta = with lib; {
    description = "This version has almost zero performance impact, as well as correctly works with stock Plasma effects";
    license = licenses.mit;
    maintainers = with maintainers; [ ];
    homepage = "https://github.com/a-parhom/LightlyShaders";          
    inherit (kwindowsystem.meta) platforms;                                  
  };                                                                         
}                                                                            
1 Like