2. Run a Program With Nix
The Nix CLI did a few things:
- It used the
nixpkgsflake reference to pull in some Nix code and targeted theponysayflake output (more on this later).
- It built the
ponysaypackage and stored the result in the Nix store.
- It ran the executable at
bin/ponysayfrom theponysaypackage.
In Nix, every program is part of a package. Packages are built using the Nix language. The
ponysaypackage has a single program (also calledponysay) but packages can contain multiple programs as well as man pages, configuration files, and more.
You may have noticed that
nix rundoesn’t require anything like anix installcommand. This makes it handy for use cases like shell scripting or experimenting with in-progress tools.