Hey, I could use some help figuring out how to add libraries to the runtime of gramps. The addon Graph View needs dot from graphviz, and goocanvas at runtime and I cannot figure out how to add it to the pkg. I’ve been trying to search for it but nix documentation is somewhat difficult. Thank you!
You need to wrap Gramps with a
PATHresource. A very easy way to do this is via asymlinkJoinon the gramps derivation which avoids needing to rebuild gramps.If you need a shared object library resource accessible at runtime, add a
LD_LIBRARY_PATHresource.Here’s an example I’ve done with Emacs, which allows Emacs to access
git,python3andunzipbinaries (my-emacsis a custom emacs derivation, replace with gramps)symlinkJoin { name = "my-emacs"; paths = [ my-emacs ]; buildInputs = [ makeBinaryWrapper ]; postBuild = '' wrapProgram $out/bin/emacs \ --suffix PATH : ${ lib.makeBinPath [ python3 git unzip ] } ''; }It should be the same for gramps. Avoid using
propagatedBuildInputssince wrapping is much cleaner. Understanding how to feed packages resources they need at runtime via wrappers is a crucial concept in derivations since packages are isolated from each other. Recommend reading over nixpkgs derivations that usewrapProgramand get familiar with the syntax. ∞ 🏳️⚧️Edie [it/its, she/her, fae/faer, love/loves, ze/hir, des/pair, none/use name, undecided]@hexbear.netOPEnglish
2·1 month agoThank you very much, I finally made it work.
Here’s how I made it work:
gramps.nix
{ lib, symlinkJoin, gramps, makeWrapper, graphviz, goocanvas3, }: symlinkJoin { name = "my-gramps"; paths = [ gramps ]; buildInputs = [ makeWrapper ]; postBuild = '' wrapProgram $out/bin/gramps \ --prefix GI_TYPELIB_PATH : ${ lib.makeSearchPath "lib/girepository-1.0" [ goocanvas3 goocanvas3.dev ] } \ --prefix PATH : ${ lib.makeBinPath [ graphviz ] } ''; }Then simply
(pkgs-unstable.callPackage ../programs/gramps.nix {})in e.g.home.packagesand it works!!!
ⓘ 𝘛𝘩𝘪𝘴 𝘶𝘴𝘦𝘳 𝘪𝘴 𝘴𝘶𝘴𝘱𝘦𝘤𝘵𝘦𝘥 𝘰𝘧 𝘣𝘦𝘪𝘯𝘨 𝘢 𝘤𝘢𝘵. 𝘗𝘭𝘦𝘢𝘴𝘦 𝘳𝘦𝘱𝘰𝘳𝘵 𝘢𝘯𝘺 𝘴𝘶𝘴𝘱𝘪𝘤𝘪𝘰𝘶𝘴 𝘣𝘦𝘩𝘢𝘷𝘪𝘰𝘳.
I can’t remember of the top of my head, but it has something to do with overriding the
propagatedBuildInputsiirc.


