srcOnly: fix invocation and document
Previously, callPackage would try and fill the arguments such as `name` and `src` which would cause problems if those existed as top-level attributes. This also makes it clearer what part is the function signature. Then document the derivation inline in the code to explain the ellipsis and various use-cases.
This commit is contained in:
parent
539fb74a5b
commit
bbbc419186
@ -1,4 +1,19 @@
|
|||||||
{stdenv, name, src, patches ? [], buildInputs ? [], ...}:
|
{ stdenv }@orig:
|
||||||
|
# srcOnly is a utility builder that only fetches and unpacks the given `src`,
|
||||||
|
# maybe pathings it in the process with the optional `patches` and
|
||||||
|
# `buildInputs` attributes.
|
||||||
|
#
|
||||||
|
# It can be invoked directly, or be used to wrap an existing derivation. Eg:
|
||||||
|
#
|
||||||
|
# > srcOnly pkgs.hello
|
||||||
|
#
|
||||||
|
{ name
|
||||||
|
, src
|
||||||
|
, stdenv ? orig.stdenv
|
||||||
|
, patches ? []
|
||||||
|
, buildInputs ? []
|
||||||
|
, ... # needed when passing an existing derivation
|
||||||
|
}:
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
inherit src buildInputs patches name;
|
inherit src buildInputs patches name;
|
||||||
installPhase = "cp -r . $out";
|
installPhase = "cp -r . $out";
|
||||||
|
@ -450,7 +450,7 @@ in
|
|||||||
|
|
||||||
singularity-tools = callPackage ../build-support/singularity-tools { };
|
singularity-tools = callPackage ../build-support/singularity-tools { };
|
||||||
|
|
||||||
srcOnly = args: callPackage ../build-support/src-only args;
|
srcOnly = callPackage ../build-support/src-only { };
|
||||||
|
|
||||||
substituteAll = callPackage ../build-support/substitute/substitute-all.nix { };
|
substituteAll = callPackage ../build-support/substitute/substitute-all.nix { };
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user