devenv icon indicating copy to clipboard operation
devenv copied to clipboard

Import devenv from an existing flake.nix

Open DavHau opened this issue 3 years ago • 3 comments

Currently devenv forcefully replaces nix and flakes. For nix native users, or projects that already contain a flake.nix it could be interesting to import devenv as a dependency manually.

I'd like to hear your thoughts about this @domenkozar . Does mixing flake.nix and devenv.nix make sense in general or would it violate devshell in a fundamental way?

DavHau avatar Nov 17 '22 15:11 DavHau

You can already do that, the only limitation (that I plan to fix) is that flake.nix can't be in the current directory.

To define the input: https://github.com/cachix/devenv/blob/main/devenv.yaml#L7 A flake: https://github.com/cachix/devenv/blob/main/src/modules/flake.nix

domenkozar avatar Nov 17 '22 17:11 domenkozar

@DavHau I'm planning to write a guide for this, does the above answer your question?

domenkozar avatar Nov 20 '22 16:11 domenkozar

Yes, it does. Thank you

DavHau avatar Nov 20 '22 16:11 DavHau

https://github.com/cachix/devenv/pull/150

domenkozar avatar Dec 07 '22 17:12 domenkozar