# Equivalent commands for nix

**URL:** https://discourse.nixos.org/t/equivalent-commands-for-nix/61620
**Category:** Help
**Created:** [March 13, 2025, 2:06pm UTC](https://discourse.nixos.org/t/equivalent-commands-for-nix/61620 "2025-03-13T14:06:14Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![whatsthecraic](https://discourse.nixos.org/user_avatar/discourse.nixos.org/whatsthecraic/32/31466_2.png) [@whatsthecraic](https://discourse.nixos.org/u/whatsthecraic)
#### Post date: [March 13, 2025, 2:06pm UTC](https://discourse.nixos.org/t/equivalent-commands-for-nix/61620/1 "2025-03-13T14:06:14Z")

</div>

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` ?

---

<div class="post-metadata">

### Author: ![waffle8946](https://discourse.nixos.org/user_avatar/discourse.nixos.org/waffle8946/32/27221_2.png) [@waffle8946](https://discourse.nixos.org/u/waffle8946)
#### Post date: [March 13, 2025, 2:51pm UTC](https://discourse.nixos.org/t/equivalent-commands-for-nix/61620/2 "2025-03-13T14:51:16Z")

</div>

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](https://wiki.nixos.org/wiki/Nix_command) 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.

---

<div class="post-metadata">

### Author: ![waffle8946](https://discourse.nixos.org/user_avatar/discourse.nixos.org/waffle8946/32/27221_2.png) [@waffle8946](https://discourse.nixos.org/u/waffle8946)
#### Post date: [March 13, 2025, 3:14pm UTC](https://discourse.nixos.org/t/equivalent-commands-for-nix/61620/3 "2025-03-13T15:14:22Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![fzakaria](https://discourse.nixos.org/user_avatar/discourse.nixos.org/fzakaria/32/2643_2.png) [@fzakaria](https://discourse.nixos.org/u/fzakaria)
#### Post date: [March 13, 2025, 3:20pm UTC](https://discourse.nixos.org/t/equivalent-commands-for-nix/61620/4 "2025-03-13T15:20:54Z")

</div>

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](https://asciinema.org/a/MQhEmzjXA5Q22bogr5dzvfXHd)

---

<div class="post-metadata">

### Author: ![whatsthecraic](https://discourse.nixos.org/user_avatar/discourse.nixos.org/whatsthecraic/32/31466_2.png) [@whatsthecraic](https://discourse.nixos.org/u/whatsthecraic)
#### Post date: [March 20, 2025, 12:43pm UTC](https://discourse.nixos.org/t/equivalent-commands-for-nix/61620/5 "2025-03-20T12:43:46Z")

</div>

Thanks!

> [@waffle8946](#):
>
> I’ve never really had a reason to use `nix-store --realise` though, so I might be missing some use case here.

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.
