Keep your current Linux distribution.
If Nix is not installed, follow the official installation guide linked below for your platform, then open a new terminal and check nix --version. These examples run on your machine; this website does not execute shell commands.
The classic nix-shell command works without enabling flakes. It looks up packages through your configured Nixpkgs source, often a channel. If <nixpkgs> cannot be found, finish your installer’s channel setup first.
nix --version
nix-shell -p hello git
# Inside the new shell:
hello
git --version
exit
A new shell, not a container.
Within the shell, the requested programs are available on PATH. Exiting returns to the parent environment. Downloaded files can remain in /nix/store until garbage collection removes them.
This shell is not a security sandbox. Programs can still access your normal files and network. Also, an unpinned Nixpkgs source can change over time: “the same command” alone does not guarantee the same package versions.
nix-shell -p hello --run hello
# Expected program output: Hello, world!
A Nix shell changes which tools are available; it does not isolate your files or erase cached packages on exit.