mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-03-28 21:16:20 +01:00
nix-shell, nix-env: add page and fix manual link (#5060)
This commit is contained in:
parent
06b697b9f7
commit
ffa6317a54
2 changed files with 29 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
|||
# nix-env
|
||||
|
||||
> Manipulate or query Nix user environments.
|
||||
> More information: <https://nixos.org/releases/nix/latest/manual#sec-nix-env>.
|
||||
> More information: <https://nixos.org/manual/nix/stable/#sec-nix-env>.
|
||||
|
||||
- List all installed packages:
|
||||
|
||||
|
|
28
pages/common/nix-shell.md
Normal file
28
pages/common/nix-shell.md
Normal file
|
@ -0,0 +1,28 @@
|
|||
# nix-shell
|
||||
|
||||
> Start an interactive shell based on a Nix expression.
|
||||
> More information: <https://nixos.org/manual/nix/stable/#sec-nix-shell>.
|
||||
|
||||
- Start with nix expression in `shell.nix` or `default.nix` in the current directory:
|
||||
|
||||
`nix-shell`
|
||||
|
||||
- Run shell command in non-interactive shell and exit:
|
||||
|
||||
`nix-shell --run "{{command}} {{command_arguments}}"`
|
||||
|
||||
- Start with expression in `default.nix` in the current directory:
|
||||
|
||||
`nix-shell {{default.nix}}`
|
||||
|
||||
- Start with packages loaded from nixpkgs:
|
||||
|
||||
`nix-shell --packages {{package_name_1}} {{package_name_2}}`
|
||||
|
||||
- Start with packages loaded from specific nixpkgs revision:
|
||||
|
||||
`nix-shell --packages {{package_names}} -I nixpkgs={{https://github.com/NixOS/nixpkgs/archive/nixpkgs_revision.tar.gz}}`
|
||||
|
||||
- Evaluate rest of file in specific interpreter, for use in `#!-scripts` (see <https://nixos.org/manual/nix/stable/#use-as-a-interpreter>):
|
||||
|
||||
`nix-shell -i {{interpreter}} --packages {{package_names}}`
|
Loading…
Add table
Reference in a new issue