Find the derivation path for a flake

I have the following flake.nix file: https://github.com/bsepaul/climate-models/blob/ebea14c4e802b6d289f25d61194c405ce7a6f679/flake.nix. I want to find the derivation file in the /nix/store which is created when I run nix develop.

I found the store path containing the source code of the flake using the following

nix flake metadata | grep "Path" | awk '{print $2}'

/nix/store/xm4aa72f2yzpwx9w9cflndqxi5ngqxpp-source is what I got from the nix flake metadata command but running

nix show-derivation /nix/store/xm4aa72f2yzpwx9w9cflndqxi5ngqxpp-source

but that returns
error: '/nix/store/xm4aa72f2yzpwx9w9cflndqxi5ngqxpp-source' does not have a known deriver

Any help would be greatly appreciated

Path:          /nix/store/xm4aa72f2yzpwx9w9cflndqxi5ngqxpp-source

This path you see from the outputs of nix flake metadata is not what you get from running nix develop, but the current directory copied the the nix store. It is not a derivation, just a store path, that’s why nix show-derivation doesn’t work.

To know what gets run when running nix develop, you can run nix print-dev-env, you can also pipe the output into eval if you are using bash to do something similar to nix develop.

Running nix print-dev-env just returns a large shell script that does not show the the location of the .drv file. I do not know what you mean by " you can also pipe the output into eval if you are using bash to do something similar to nix develop ."

You can show the location of the .drv file with nix eval .#devShell.<system>.drvPath

nix print-dev-env | eval # roughly equivalent to `nix develop`
1 Like

Thank you very much, I appreciate your time and help.