devenv: devenv up broken with flakes
Describe the bug devenv up not working with flakes
To reproduce use example flake in the guides and run devenv up https://devenv.sh/guides/using-with-flakes/#modifying-your-flakenix-file
gives the error
error: flake does not provide attribute 'packages.x86_64-linux.devenv-up', 'legacyPackages.x86_64-linux.devenv-up' or 'devenv-up'
Version devenv: 0.6.3
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 35
- Comments: 15 (4 by maintainers)
Commits related to this issue
- Switch devenv from development branch to v0.6.3 Broke in https://github.com/matrix-org/synapse/pull/16019. This would have been caught if someone ran 'devenv up' during manual testing of that PR, or ... — committed to matrix-org/synapse by anoadragon453 3 years ago
- Switch devenv from development branch to v0.6.3 Broke in https://github.com/matrix-org/synapse/pull/16019. This would have been caught if someone ran 'devenv up' during manual testing of that PR, or ... — committed to matrix-org/synapse by anoadragon453 3 years ago
- Fix devenv-up missing with flakes https://github.com/cachix/devenv/issues/756 — committed to ereslibre/nixities by ereslibre 3 years ago
github:cachix/devenv/6a30b674fb5a54eff8c422cc7840257227e0ead2is also working for me, withdotenvintegrationYou can workaround it for now by using revision
github:cachix/devenv/9ba9e3b908a12ddc6c43f88c52f2bf3c1d1e82c1as an input.@zarybnicky I circumvent this with process-compose via this
enterShellsnippet:and gitignoring the symlinked file. This way I can just use the plain
process-compose upwith all the convenience of config.processes and direnv caching.Thanks, got this to fix my config too.
Added
devenv-upas a flake output in context:Did some analysis based on the Git history of
src/devenv-devShell.nixThe last commit in the history of that file that worked was d12fb308ef41e693dd3142c7d16af21809bbc948. Everything after that broke.
So we can conclude that commit ddba5b442488a0036bba88097b9048d83dd0e709 broke the
devenv upwith flakes.And indeed, if I use the commit just before the commit in question, 1e4701fb1f51f8e6fe3b0318fc2b80aed0761914, the example starts working again.
Using the default flake template for devenv i had to add the following to my flake.nix
as a sibling of
devShells = ....I’ll look into this tomorrow.
The workarounds and implementation use the procfileScript from the
defaultdevShell. Are multiple devShells not supported, or am I incorrect in assuming that theprocfileScriptof the respective devShell would need to be used?For instance I have a
defaultshell with basic tooling, and anotherdevShellwhich sets up processes. Having applied the workaround, when Inix develop .#second-shell --impureI get the message:Minimal reproducible example
flake.nix
Actual Output
Expected Output
The suggested commits didn’t work for me since I was using some newer options. I ended up adding the following to my flake as a workaround:
packages.devenv-up = self.devShell.${system}.config.procfileScript;basically I’m manually doing this https://github.com/cachix/devenv/blob/63d20fe09aa09060ea9ec9bb6d582c025402ba15/flake-module.nix#L51