Guide for using with npins
Please add a possibility for using devenv shells with npins. There are 2 supported ways of using devenv that I know of:
- using the devenv cli calling
devenv shellwhich supports specifying inputs with devenv.yaml - using flakes calling
nix develop --impureafter defining a devenv dev shell in the flake.
The issue with the first method is that I can't use the same input specification across my NixOS and home manager modules, it's only for devenv. The issue with the second method is that is requires using flakes, which is non-standard nix.
It would be great to have an officially supported way to use devenv with npins, something like:
# default.nix
let
sources = import ./npins;
pkgs = import sources.nixpkgs { ... };
devenv = import sources.devenv { ... }; # maybe inject nixpkgs here?
in
{
# activate with `nix-shell -A devshell`
devshell = devenv.mkShell {
# or somehow inject pkgs here
imports = [ ./devenv.nix ];
};
}
If this possibility already exists please document it. If the documentation already exists I apologise and kindly ask that you point me to where I can find it.
For (1) see https://github.com/cachix/devenv/pull/2092
@balintbarna supporting devenv and also flakes already takes a lot of our time - if someone writes guide for npins I'm happy to link to it!
@domenkozar Someone tried here and failed https://www.reddit.com/r/NixOS/comments/1mvfceq/comment/naqq0gh/ It would be great if there was a mkShell function in devenv that can be called without using flakes and just pass in pkgs, inputs and modules, same as the flake function but works without flakes.
@domenkozar I got devenv working with an npins based setup.
I wrote a wrapper function which provides a very simple interface and consumes a standard devenv configuration file. It activates with nix-shell and doesn't require flakes or the devenv CLI, as it uses standard Nix.
I cheated a bit by setting self to ./., not sure if that would lead to issues but I haven't seen any yet. What do you think?