Linux command
nix-run 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Run package from nixpkgs
nix run nixpkgs#[hello]
Run from flake
nix run [.#default]
Run with arguments
nix run nixpkgs#[cowsay] -- "[Hello]"
Run from GitHub
nix run [github:owner/repo]
Run specific app
nix run [.#apps.x86_64-linux.default]
说明
nix run runs programs from Nix packages. No installation required. The tool fetches and runs packages. Temporary execution without pollution.
参数
- --impure
- Allow impure evaluation.
- --help
- Display help information.
FAQ
What is the nix-run command used for?
nix run runs programs from Nix packages. No installation required. The tool fetches and runs packages. Temporary execution without pollution.
How do I run a basic nix-run example?
Run `nix run nixpkgs#[hello]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --impure do in nix-run?
Allow impure evaluation.