<justanotheruser>
hmm, this method has some issue with dependency resolution
<justanotheruser>
had to do sys.path.append('${pkgs.python2Packages.libkeepass}/${pkgs.python2.sitePackages}'); sys.path.append('${pkgs.python2Packages.pycryptodome}/${pkgs.python2.sitePackages}'); sys.path.append('${pkgs.python2Packages.lxml}/${pkgs.python2.sitePackages}')
<justanotheruser>
but now it works, thanks!
<immae>
good
<immae>
(you can optimise that too)
<immae>
(the dependency resolution)
<SumnerEvans[m]>
This seems pretty ugly. We should probably make an actual fix for this.
<SumnerEvans[m]>
I am glad you found a workaround, though!
<SumnerEvans[m]>
Maybe open an issue to keep track of this (and include your current workaround)?
<justanotheruser>
immae: is there some option which includes site-packages for the package and all its dependencies?
<immae>
this should work: sys.path.append('${pkgs.python2.withPackages(p: [p.libkeepass])}/${pkgs.python2.sitePackages}');
<immae>
justanotheruser: yes that ^
<justanotheruser>
thanks!
<immae>
(try it first)
<immae>
(I wrote it blindly)
<justanotheruser>
yes, it works
<immae>
cool
<justanotheruser>
SumnerEvans[m]: let me see if I can get the dependencies set by an option
<rycee>
I think you can use `wrapPythonPrograms` for automatically setting `sys.path` based on the build inputs.
<rycee>
somehow
<rycee>
Never tried it myself :-)
<immae>
This works only if your input it a file
<immae>
here it’s passed as a text (which is then passed as a file in hm)
<immae>
(as far as I see from the wrapPythonPrograms function, I never tried it myself either)
<rycee>
But you should be able to call `wrapPythonPrograms` inside a `runCommandLocal` body where the code text is injected using `passAsFile`?
<immae>
hmm no?
<immae>
Because the said text is called via python directly
<immae>
(I might miss something of your suggestion though)
<rycee>
Something like `mkdir $out/bin/blah; mv $inputFile $out/bin/blah; wrapPythonProgramsIn $out/bin/blah $pythonInputs` perhaps? Then read out the content of `$out/bin/blah` and put where you want it.
<immae>
wrapPythonPrograms will produce a (bash) shell script that wraps path and all
<rycee>
Ah, right. Then I dunno :-/
<rycee>
I guess you can write your own wrapper script that does the type of wrapping you need.
<immae>
yes sure
<immae>
considering how simple it is that’s clearly an option
<rycee>
I'm not sure its super simple (considering the wrapper in Nixpkgs including `magicalSedExpression`, which does seem a bit magical) but seems doable.
<rycee>
Ah, maybe they need to do something more fancy in the wrapper. It would be sweet if your example works.
<rycee>
I don't really know Python so can't really tell why the wrapper in Nixpkgs is the way it is.
MmeQuignon has quit [Ping timeout: 245 seconds]
cyphase has quit [Ping timeout: 252 seconds]
crystalxo has joined #home-manager
cyphase has joined #home-manager
<crystalxo>
Hey everyone - how come when using wayland and sway that you need to do add `dropbox start` to the startup command list? Is there a reason its not automatic?