summary refs log tree commit diff
path: root/pkgs/build-support/src-only/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-05-13 00:32:00 +0000
committerAlyssa Ross <hi@alyssa.is>2020-05-13 00:41:26 +0000
commit439d80fbdcdf6245444e99e3764f233122c86358 (patch)
treebd769aabc0c8e46d3fdf8f0cc80297463e7d0dba /pkgs/build-support/src-only/default.nix
parentcc2d9c385f776f38fa37656b8440b5c4a460e9a7 (diff)
parent9f5e9ef4b71a2a1ea8efef56f5876cdc846d6387 (diff)
downloadnixpkgs-439d80fbdcdf6245444e99e3764f233122c86358.tar
nixpkgs-439d80fbdcdf6245444e99e3764f233122c86358.tar.gz
nixpkgs-439d80fbdcdf6245444e99e3764f233122c86358.tar.bz2
nixpkgs-439d80fbdcdf6245444e99e3764f233122c86358.tar.lz
nixpkgs-439d80fbdcdf6245444e99e3764f233122c86358.tar.xz
nixpkgs-439d80fbdcdf6245444e99e3764f233122c86358.tar.zst
nixpkgs-439d80fbdcdf6245444e99e3764f233122c86358.zip
Merge remote-tracking branch 'nixpkgs/master' into master
Diffstat (limited to 'pkgs/build-support/src-only/default.nix')
-rw-r--r--pkgs/build-support/src-only/default.nix29
1 files changed, 27 insertions, 2 deletions
diff --git a/pkgs/build-support/src-only/default.nix b/pkgs/build-support/src-only/default.nix
index c2f7cfb9399..c721fdf40c6 100644
--- a/pkgs/build-support/src-only/default.nix
+++ b/pkgs/build-support/src-only/default.nix
@@ -1,6 +1,31 @@
-{ 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 ? []
+, # deprecated, use the nativeBuildInputs
+  buildInputs ? []
+, # used to pass extra unpackers
+  nativeBuildInputs ? []
+, # needed when passing an existing derivation
+  ...
+}:
 stdenv.mkDerivation {
-  inherit src buildInputs patches name;
+  inherit
+    buildInputs
+    name
+    nativeBuildInputs
+    patches
+    src
+    ;
   installPhase = "cp -r . $out";
   phases = ["unpackPhase" "patchPhase" "installPhase"];
 }