IssueRaiser

Documentation for mkDerivation

After a year of using NixOS, `stdenv.mkDerivation` is still something of a mystery to me. I only know how to use it by copying examples from other packages. Is there documentation somewhere - most importantly, a list of _all_ of the arguments that `mkDerivation` accepts, and what each of them does? (And if it does already exist, how can we make it more discoverable?) I can see some of them in [`pkgs/stdenv/generic/default.nix`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/default.nix#L92-L109): ``` # Add a utility function to produce derivations that use this # stdenv and its shell. mkDerivation = { buildInputs ? [] , nativeBuildInputs ? [] , propagatedBuildInputs ? [] , propagatedNativeBuildInputs ? [] , crossConfig ? null , meta ? {} , passthru ? {} , pos ? null # position used in error messages and for meta.position , separateDebugInfo ? false , outputs ? [ "out" ] , __impureHostDeps ? [] , __propagatedImpureHostDeps ? [] , sandboxProfile ? "" , propagatedSandboxProfile ? "" , ... } @ attrs: ``` But clearly that arg list isn't complete - for example, it doesn't contain `src`, or any of the build phases.

Posted by chris-martin on Sep 16, 2016, 10:16 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.4,500 issues0 comments

github (Software)

Documentation for mkDerivation

chris-martinSep 16, 2016, 10:16 PM

After a year of using NixOS, `stdenv.mkDerivation` is still something of a mystery to me. I only know how to use it by copying examples from other packages. Is there documentation somewhere - most importantly, a list of _all_ of the arguments that `mkDerivation` accepts, and what each of them does? (And if it does already exist, how can we make it more discoverable?) I can see some of them in [`pkgs/stdenv/generic/default.nix`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/default.nix#L92-L109): ``` # Add a utility function to produce derivations that use this # stdenv and its shell. mkDerivation = { buildInputs ? [] , nativeBuildInputs ? [] , propagatedBuildInputs ? [] , propagatedNativeBuildInputs ? [] , crossConfig ? null , meta ? {} , passthru ? {} , pos ? null # position used in error messages and for meta.position , separateDebugInfo ? false , outputs ? [ "out" ] , __impureHostDeps ? [] , __propagatedImpureHostDeps ? [] , sandboxProfile ? "" , propagatedSandboxProfile ? "" , ... } @ attrs: ``` But clearly that arg list isn't complete - for example, it doesn't contain `src`, or any of the build phases.

Comments (0)

No comments yet. Start the discussion.

Comment on this issue