Equivalent commands for nix

How do you find the equivalent command for nix from the legacy utilities. For instance, what is the equivalent of nix-store -r <ref> when using nix ?

1 Like

I hate to say it but it’s an rtfm moment.
It would be nice to have a guide for equivalent commands and caveats, and Nix command - NixOS Wiki tried to start something like this at the bottom of the page, perhaps we could help expand this?
However, do be careful that the new CLI is not 100% stable so some differences may appear based on the nix version.

1 Like

Also to answer your specific example:

nix-store --realise <store path> and nix build <store path> appear to be equivalent. (This includes both store derivations and store objects.)

I’ve never really had a reason to use nix-store --realise though, so I might be missing some use case here.

I went through this endeavor with dynamic derivations.

There aren’t equivalences with the old commands which is unfortunate and some of the new experimental features somehow only work via the new command workflow.

In particular nix-instantiate and nix-eval are not great equivalences.

I personally still like the old commands; the new one seems to write things to stdout (even with -L) and disappear.

Seeing the logs persisted is a challenge… I personally don’t like curses type stuff; I rather it just spit it all out.
https://asciinema.org/a/MQhEmzjXA5Q22bogr5dzvfXHd

3 Likes

Thanks!

My use case is to debug a core dump from a crashed remote server, the nix store is used to retrieve that particular version of the program that the server was running.