mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-18 07:46:09 +01:00
052bb41410
without stable ids on headings we cannot generate stable links to these headings. nrd complains about this, but the current docbook workflow does not. a few generated ids remain, mostly in examples and footnotes. most of the examples are generated by nixdoc (which has since gained MD export functions, and the MD export does generate IDs).
1.2 KiB
1.2 KiB
pkgs.mkShell
pkgs.mkShell
is a specialized stdenv.mkDerivation
that removes some
repetition when using it with nix-shell
(or nix develop
).
Usage
Here is a common usage example:
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
packages = [ pkgs.gnumake ];
inputsFrom = [ pkgs.hello pkgs.gnutar ];
shellHook = ''
export DEBUG=1
'';
}
Attributes
name
(default:nix-shell
). Set the name of the derivation.packages
(default:[]
). Add executable packages to thenix-shell
environment.inputsFrom
(default:[]
). Add build dependencies of the listed derivations to thenix-shell
environment.shellHook
(default:""
). Bash statements that are executed bynix-shell
.
... all the attributes of stdenv.mkDerivation
.
Building the shell
This derivation output will contain a text file that contains a reference to all the build inputs. This is useful in CI where we want to make sure that every derivation, and its dependencies, build properly. Or when creating a GC root so that the build dependencies don't get garbage-collected.