From 03fb2c1f32825dd7d43a456667db5848b47f4ea3 Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Tue, 30 Aug 2016 04:46:59 +0300 Subject: [PATCH] doc: Document changes to multiple-output conventions --- doc/multiple-output.xml | 6 +++--- nixos/doc/manual/release-notes/rl-1609.xml | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/doc/multiple-output.xml b/doc/multiple-output.xml index 1821861adf7..309254f76aa 100644 --- a/doc/multiple-output.xml +++ b/doc/multiple-output.xml @@ -29,15 +29,15 @@
Using a split package In the Nix language the individual outputs can be reached explicitly as attributes, e.g. coreutils.info, but the typical case is just using packages as build inputs. - When a multiple-output derivation gets into a build input of another derivation, the first output is added (.dev by convention) and also propagatedBuildOutputs of that package which by default contain $outputBin and $outputLib. (See .) + When a multiple-output derivation gets into a build input of another derivation, the dev output is added if it exists, otherwise the first output is added. In addition to that, propagatedBuildOutputs of that package which by default contain $outputBin and $outputLib are also added. (See .)
Writing a split derivation Here you find how to write a derivation that produces multiple outputs. In nixpkgs there is a framework supporting multiple-output derivations. It tries to cover most cases by default behavior. You can find the source separated in <nixpkgs/pkgs/build-support/setup-hooks/multiple-outputs.sh>; it's relatively well-readable. The whole machinery is triggered by defining the outputs attribute to contain the list of desired output names (strings). - outputs = [ "dev" "out" "bin" "doc" ]; - Often such a single line is enough. For each output an equally named environment variable is passed to the builder and contains the path in nix store for that output. By convention, the first output should usually be dev; typically you also want to have the main out output, as it catches any files that didn't get elsewhere. + outputs = [ "bin" "dev" "out" "doc" ]; + Often such a single line is enough. For each output an equally named environment variable is passed to the builder and contains the path in nix store for that output. By convention, the first output should contain the executable programs provided by the package as that output is used by Nix in string conversions, allowing references to binaries like ${pkgs.perl}/bin/perl to always work. Typically you also want to have the main out output, as it catches any files that didn't get elsewhere. There is a special handling of the debug output, described at . diff --git a/nixos/doc/manual/release-notes/rl-1609.xml b/nixos/doc/manual/release-notes/rl-1609.xml index 1245411be17..29fdc104a7d 100644 --- a/nixos/doc/manual/release-notes/rl-1609.xml +++ b/nixos/doc/manual/release-notes/rl-1609.xml @@ -34,6 +34,17 @@ following incompatible changes: + + A large number of packages have been converted to use the multiple outputs feature + of Nix to greatly reduce the amount of required disk space. This may require changes + to any custom packages to make them build again; see the relevant chapter in the + Nixpkgs manual for more information. (Additional caveat to packagers: some packaging conventions + related to multiple-output packages + were changed + late (August 2016) in the release cycle and differ from the initial introduction of multiple outputs.) + + + Shell aliases for systemd sub-commands were dropped: