There’s a lot of different types of dependencies, especially if you want to bother with cross-compilation. Since you’re doing a poetry project though, you’re probably better off just sticking to these general rules for same-architecture dependencies:
nativeBuildInputs for build dependencies only, stuff you need to build the package but not to run it.
buildInputs for build and runtime dependencies, stuff you need to build the package and to run it.
propagatedBuildInputs for build dependencies that people will need when they’re using your package as a library later-on.
At least, this is my basic understanding of it, and the three most common types I’ve seen.
Basically, try putting those packages in buildInputs instead.
As for the difference between mkPoetryApplication and mkPoetryEnv, the first will give you just a binary that under-the-hood uses poetry and python, but just provides the user something they run, while the second will give you a python REPL with the dependencies built.
I’ve seen the first used primarily for standalone apps, and the second for specific environment tools, like running Django on an Nginx Unit server.
$ nix buildwarning: Git tree '/builds/gt-notebook/wiki' is dirty$ sh build.shbuild.sh: line 4: grep: command not foundbuild.sh: line 4: xargs: command not found
And later pandoc not found.
So my mistake here was perhaps to add this dependency into the flake output and not into the docker nixos/nix-flakes used by gitlab runner ?
Ah, I see, you’re trying to make a polyglot ci system based off Docker, GitLab, and Nix. So you guessed right, the mistake you made is not building your own Docker image on top of the nixpkgs/nix-flakes:latest image where you add those dependencies to the Docker image with nix-env, since you don’t need them when you’re building or running your app, but to move your app around and run scripts on your built app.
That way, when your scripts run, they should find those dependencies on the path.
I continue to post my result here, perhaps that interest other nix haskell/flakes newbies like me …
To be short, after @gh0st answer me, i finally found that pkgs.pandoc is not updated with the latest version … or … i need an updated version for my python package.
I try with haskellpackages.pandoc_xxx… on more recent version, but they need some packages/dependencies not available in hackage.
SO i take the road to create a flake package that compile latest pandoc
I update my StackOverflow question with some result, using Haskell.nix
I tried using nix flakes with poetry2nix, and i see that all the dependencies are being build. But when I run nix develop .#mkreports, I only get a python without any packages installed.
I tried that as well, with no success. mkPoetryEnv in the end at least gives me the editable env when I build it. and it is useable this way. Maybe I need to wrap this in another mkShell or something?
run nix develop .#mypackage and then be dropped into a shell, where the PATH has been set correctly so that when I call python, the python version with all installed dependencies is available in the shell.
Should work with either mkPoetryEnv and mkPoetryApplication, where the former also provides the application in editable mode and the former only the dependencies.
Ok - it does. Was a mistake of mine. I had source ~/.nix-profile/bin in my home-manager bashrc instead of profile. On initiating nix-shell, the ~/.nix-profile/bin was added to the front of my path, with python installed there then shadowing the version that was available in my shell. Thanks for your help anyway and sorry about the mistake.