How to fetch flake in shell.nix?

Hi!

I’d like to add a nix shell to a project I don’t own, for my own convenience.
I can add shell.nix file, but can I import a flake there? With the aim of providing in the shell a package that’s available as a flake output.

Alternatively I could add a flake.nix file, but this doesn’t work as I can’t add the file to repository. Is best I can do to create a separate flake and run it’s shell with something like nix run ../shell-flake/.#.default?

Thanks!

You may be able to use builtins.getFlake for this.

This isn’t mine, but per a search on gh you probably want something like https://github.com/SlimeVR/SlimeVR-Server/blob/d9955d10e3f055491cea4d6a7e7edef0788235f2/shell.nix#L2

1 Like

oh damn! How did I miss this! thanks

1 Like