I have to goal of doing “integrated development” for KDE/Plasma components, which means:
I have a local repository clone, e.g. ~/code-repositories/public/KDE/utilities/print-manager
I override selected packages’ src attribute to point to the local clone
I can immediately see changes in effect in my DE after a nixos-rebuild switch
I know I could build them standalone without having to interfere with my configuration.nix/environment.systemPackages, but for many components which are part of the currently running session this makes the impossible to properly test them, so I want to have them be part of my regular system environment.
This has the desired effect when explicitly adding libsForQt5.print-manager to environment.systemPackages, but it has absolutely no effect when libsForQt5.print-manager is added to environment.systemPackagesthrough the Plasma5 module.
Having it in both places also causes collisions on rebuild, e.g.:
warning: collision between `/nix/store/6lvp44lpck0im1rsfipbk9z69ys7vnxd-print-manager-21.12.2/share/knotifications5/printmanager.notifyrc' and `/nix/store/zq26554a0dh53qzr8hbb549ba3idn1k7-print-manager-21.12.2/share/knotifications5/printmanager.notifyrc'
warning: collision between `/nix/store/6lvp44lpck0im1rsfipbk9z69ys7vnxd-print-manager-21.12.2/share/plasma/plasmoids/org.kde.plasma.printmanager/metadata.json' and `/nix/store/zq26554a0dh53qzr8hbb549ba3idn1k7-print-manager-21.12.2/share/plasma/plasmoids/org.kde.plasma.printmanager/metadata.json'
warning: collision between `/nix/store/6lvp44lpck0im1rsfipbk9z69ys7vnxd-print-manager-21.12.2/share/plasma/plasmoids/org.kde.plasma.printmanager/contents/ui/PopupDialog.qml' and `/nix/store/zq26554a0dh53qzr8hbb549ba3idn1k7-print-manager-21.12.2/share/plasma/plasmoids/org.kde.plasma.printmanager/contents/ui/PopupDialog.qml'
So it looks like manually adding it to environment.systemPackages and what the Plasma5 module is doing generates two completely distinct fixed points for the pkg libsForQt5.print-manager.
Any ideas:
how to get this working?
why this is a separate fixed point?
how to “debug” this? I failed getting lib.debug.traceSeq working to get a “backtrace” of this situation.
I would simply use a nixpkgs checkout. There I’d edit the interesting *.nix files to redirect source in whatever way I’d like (fetchgit, local dir with a checkout). Then sudo nixos-rebuild -I nixpkgs=path/to/nixpkgs test
EDIT: you can also do it almost the same way in case you’re using flake NixOS.
Using a local shallow clone of nixpkgs is actually what I used to do and why I’m looking now for a “proper solution”, as I’m tired of having to keep my nixpkgs clone rebased and felt a purely declarative approach should be possible and would theoretically make my life a lot easier.
I would expect it to work for the NixOS module, the only issue would occur if other packages in libsForQt5 depend on print-manager, in which case they would still be using the old one. To handle that properly, you need overrideScope', see Overlays - NixOS Wiki
Nothing happens on a rebuild, unless I explicitly add libsForQt5.print-manager to environment.systemPackages - then every modification in /home/eliasp/code-repositories/public/KDE/utilities/print-manager is picked up as expected.
Just for others that find this thread: I did not try it with print-manager, but had the same problem with kdenlive.
I was successful after overriding plasma5Packages instead of libsForQt515.