1
0
Fork 0
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:
Morgan Erlich 2021-01-01 17:12:38 -05:00 committed by GitHub
parent 06b697b9f7
commit ffa6317a54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 1 deletions

View file

@ -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
View 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}}`