Add option to link additional package outputs into system.path
This is necessary to get stuff like separate manpages, info files, debug symbols, etc.
This commit is contained in:
parent
3e732f65cb
commit
58e9440b89
|
@ -71,8 +71,16 @@ in
|
||||||
# to work.
|
# to work.
|
||||||
default = [];
|
default = [];
|
||||||
example = ["/"];
|
example = ["/"];
|
||||||
description = "List of directories to be symlinked in `/run/current-system/sw'.";
|
description = "List of directories to be symlinked in <filename>/run/current-system/sw</filename>.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
outputsToLink = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [];
|
||||||
|
example = [ "doc" ];
|
||||||
|
description = "List of package outputs to be symlinked into <filename>/run/current-system/sw</filename>.";
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
system = {
|
system = {
|
||||||
|
@ -119,7 +127,7 @@ in
|
||||||
system.path = pkgs.buildEnv {
|
system.path = pkgs.buildEnv {
|
||||||
name = "system-path";
|
name = "system-path";
|
||||||
paths = config.environment.systemPackages;
|
paths = config.environment.systemPackages;
|
||||||
inherit (config.environment) pathsToLink;
|
inherit (config.environment) pathsToLink outputsToLink;
|
||||||
ignoreCollisions = true;
|
ignoreCollisions = true;
|
||||||
# !!! Hacky, should modularise.
|
# !!! Hacky, should modularise.
|
||||||
postBuild =
|
postBuild =
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# a fork of the buildEnv in the Nix distribution. Most changes should
|
# a fork of the buildEnv in the Nix distribution. Most changes should
|
||||||
# eventually be merged back into the Nix distribution.
|
# eventually be merged back into the Nix distribution.
|
||||||
|
|
||||||
{ perl, runCommand }:
|
{ perl, runCommand, lib }:
|
||||||
|
|
||||||
{ name
|
{ name
|
||||||
|
|
||||||
|
@ -21,6 +21,10 @@
|
||||||
# directories in the list is not symlinked.
|
# directories in the list is not symlinked.
|
||||||
pathsToLink ? ["/"]
|
pathsToLink ? ["/"]
|
||||||
|
|
||||||
|
, # The package outputs to include. By default, only the default
|
||||||
|
# output is included.
|
||||||
|
outputsToLink ? []
|
||||||
|
|
||||||
, # Root the result in directory "$out${extraPrefix}", e.g. "/share".
|
, # Root the result in directory "$out${extraPrefix}", e.g. "/share".
|
||||||
extraPrefix ? ""
|
extraPrefix ? ""
|
||||||
|
|
||||||
|
@ -36,7 +40,9 @@
|
||||||
runCommand name
|
runCommand name
|
||||||
{ inherit manifest ignoreCollisions passthru pathsToLink extraPrefix postBuild buildInputs;
|
{ inherit manifest ignoreCollisions passthru pathsToLink extraPrefix postBuild buildInputs;
|
||||||
pkgs = builtins.toJSON (map (drv: {
|
pkgs = builtins.toJSON (map (drv: {
|
||||||
paths = [ drv ]; # FIXME: handle multiple outputs
|
paths =
|
||||||
|
[ drv ]
|
||||||
|
++ lib.concatMap (outputName: lib.optional (drv.${outputName}.outPath or null != null) drv.${outputName}) outputsToLink;
|
||||||
priority = drv.meta.priority or 5;
|
priority = drv.meta.priority or 5;
|
||||||
}) paths);
|
}) paths);
|
||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
|
|
|
@ -261,7 +261,7 @@ let
|
||||||
{ substitutions = { inherit autoconf automake gettext libtool; }; }
|
{ substitutions = { inherit autoconf automake gettext libtool; }; }
|
||||||
../build-support/setup-hooks/autoreconf.sh;
|
../build-support/setup-hooks/autoreconf.sh;
|
||||||
|
|
||||||
buildEnv = callPackage ../build-support/buildenv {};
|
buildEnv = callPackage ../build-support/buildenv { }; # not actually a package
|
||||||
|
|
||||||
buildFHSEnv = callPackage ../build-support/build-fhs-chrootenv/env.nix {
|
buildFHSEnv = callPackage ../build-support/build-fhs-chrootenv/env.nix {
|
||||||
nixpkgs = pkgs;
|
nixpkgs = pkgs;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user