nix-classic
Run Nix expressions in the classic evaluator
TLDR
Search for a package in nixpkgs via its name
Start a shell with the specified packages available
Install some packages permanently
Show all dependencies of a store path (package), in a tree format
Update the channels (repositories)
Remove unused paths from Nix store
SYNOPSIS
nix-classic
subcommand [options...]
(e.g., nix-classic build [options...], nix-classic env [options...])
This synopsis represents the usage of the classic Nix commands, which nix-classic
refers to. The actual nix-classic
command itself, if it exists as a wrapper, typically dispatches to these specific tools.
PARAMETERS
build
Invokes functionality similar to nix-build for building derivations.
env
Invokes functionality similar to nix-env for managing user environments.
store
Invokes functionality similar to nix-store for low-level Nix store operations.
shell
Invokes functionality similar to nix-shell for creating ad-hoc development environments.
instantiate
Invokes functionality similar to nix-instantiate for evaluating Nix expressions.
collect-garbage
Invokes functionality similar to nix-collect-garbage for cleaning up the Nix store.
copy-closure
Invokes functionality similar to nix-copy-closure for copying derivations to a remote machine.
DESCRIPTION
nix-classic
conceptually represents the traditional command-line interface of the Nix package manager, comprising individual executables like nix-build, nix-env, nix-store, nix-shell, and nix-instantiate. Before the introduction of the unified nix command (e.g., nix build, nix run), these distinct tools were the primary way to interact with Nix. The term nix-classic is often used to differentiate this older paradigm from the modern, streamlined nix CLI, either as an alias or a wrapper script, to provide backward compatibility or to access specific advanced functionalities that are more exposed in the classic interface.
CAVEATS
Legacy Interface: nix-classic
refers to an older, less unified command-line interface. New users are generally encouraged to use the modern, unified nix
command for most operations (e.g., nix build
instead of nix-build
).
Availability: The nix-classic
executable itself might not be directly available on all Nix installations; it's often a conceptual grouping or an alias for the direct nix-*
binaries. Functionality is accessed via the individual classic commands.
UNIFIED VS. CLASSIC CLI
The Nix ecosystem has two primary command-line interfaces: the classic one (accessed via distinct nix-*
executables, or conceptually through nix-classic
) and the unified one (via nix
). The unified CLI aims for greater consistency and user-friendliness across common operations.
BACKWARD COMPATIBILITY
The classic commands are maintained largely for backward compatibility with existing scripts and user muscle memory. Many advanced features and low-level operations are still most directly accessible through the classic interfaces.
HISTORY
The concept of nix-classic
arose with the significant evolution of the Nix command-line interface. Before Nix 2.0, all interactions were through distinct binaries like nix-build
, nix-env
, nix-store
, etc. With the introduction and maturation of the unified nix
command (e.g., nix build
, nix shell
, nix run
), these older commands were grouped under the informal "classic" designation. This distinction became important to manage the transition and provide clarity, allowing users to choose between the older, well-established interface and the newer, more consistent one. While the new CLI is the recommended path for most tasks, the classic commands remain fully supported and essential for certain advanced or specific use cases.