nix-shell
SKILL.md
nix-shell
When you want to execute a command but it's not in your PATH, you can use nix shell or nix run to create a temporary environment. nix shell will create a new shell with the specified packages available, while nix run will run a command directly without a shell.
Before using nix shell or nix run, you may want to figure out which packages you need for your command. User will have nix in their system with package index available. You can use nix-locate to search for packages. For example:
nix-locate /bin/w | rg "/bin/w\$" # to find the package that provides /bin/w
After finding the package, you can use nix shell to create a temporary environment with that package available, or nix run to run the command directly. For example, to use ffmpeg:
# using nix shell
nix shell nixpkgs#ffmpeg
ffmpeg <params>
# using nix run
nix run nixpkgs#ffmpeg <params>
When to use
When you want to run a command that isn't in your PATH.
Instructions
- (optional) Find the package using
nix-locate. - Use
nix shellto create a temporary environment with that package available, ornix runto run the command directly.
Weekly Installs
1
Repository
beiyanyunyi/skillsFirst Seen
3 days ago
Security Audits
Installed on
amp1
cline1
opencode1
cursor1
kimi-cli1
kiro-cli1