Using `devenv tasks run` without direnv hooks (e.g. GitLab CI and friends)

I am trying to build my Mkdocs-based digital garden site (via pipenv’s Pipfile scripts) and the deploy straight to Cloudflare Workers (as a static site) on GitLab CI, but I am getting command not found errors.

$ devenv tasks run wiki:deploy
• Evaluating tasks ...
Using Cachix: nixpkgs-python, devenv
✔ Evaluating tasks in 2.44s
Running tasks     wiki:deploy
Running           wiki:deploy
Failed            wiki:deploy (20.53ms)
1 Failed
--- wiki:deploy failed with error: Task exited with status: exit status: 127
--- wiki:deploy stdout:
--- wiki:deploy stderr:
0000.00: /nix/store/k40lljy0p3sm3dgik8vzm8rri953jhmr-wiki-deploy: line 3: pipenv: command not found
---
Error:   × Some tasks failed

Since I can’t just hack around the devenv Docker image to handle .envrc loading for caching devenv evals on future devenv shell runs in the same job (but that would involve using self-hosted runners instead of the ones provided on GitLab SaaS or the instance you are using if outside of GitLab.com), is there any workarounds on that?

Reproducibility notes

Can you install pipenv into your devenv.nix? That should propagate it to the tasks.

I have pipenv on my devenv.nix’s packages section.

https://gitlab.com/andreijiroh-dev/wiki/-/blob/main/devenv.nix#L8-21

Could you open an issue on GitHub · Where software is built, I’ll take a look :slight_smile:

1 Like