summary refs log tree commit diff
path: root/pkgs/build-support/fetchgitiles
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-11-24 19:58:19 +0000
committerAlyssa Ross <hi@alyssa.is>2019-12-02 22:44:33 +0000
commitfe16f7d7f91317e087e96089c2a2b9bfe0ab50d0 (patch)
tree35d3d6d57e4695317544aacb4709df435912059d /pkgs/build-support/fetchgitiles
parenta8508f7266f245756b78557861d315e05625c6b2 (diff)
downloadnixpkgs-fe16f7d7f91317e087e96089c2a2b9bfe0ab50d0.tar
nixpkgs-fe16f7d7f91317e087e96089c2a2b9bfe0ab50d0.tar.gz
nixpkgs-fe16f7d7f91317e087e96089c2a2b9bfe0ab50d0.tar.bz2
nixpkgs-fe16f7d7f91317e087e96089c2a2b9bfe0ab50d0.tar.lz
nixpkgs-fe16f7d7f91317e087e96089c2a2b9bfe0ab50d0.tar.xz
nixpkgs-fe16f7d7f91317e087e96089c2a2b9bfe0ab50d0.tar.zst
nixpkgs-fe16f7d7f91317e087e96089c2a2b9bfe0ab50d0.zip
fetchFromGitiles: init
This has the same motivation as fetchFromGitHub/fetchFromGitLab --
it's cheaper to download a tarball of a single revision than it is to
download a whole history.

I could have gone with domain/group/repo, like fetchFromGitLab, but it
would have made implementation more difficult, and this syntax means
it's a drop-in replacement for fetchgit, so I decided it wasn't worth
it.
Diffstat (limited to 'pkgs/build-support/fetchgitiles')
-rw-r--r--pkgs/build-support/fetchgitiles/default.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkgs/build-support/fetchgitiles/default.nix b/pkgs/build-support/fetchgitiles/default.nix
new file mode 100644
index 00000000000..827680992d6
--- /dev/null
+++ b/pkgs/build-support/fetchgitiles/default.nix
@@ -0,0 +1,10 @@
+{ fetchzip, lib }:
+
+{ url, rev, name ? "source", ... } @ args:
+
+fetchzip ({
+  inherit name;
+  url = "${url}/+archive/${rev}.tar.gz";
+  stripRoot = false;
+  meta.homepage = url;
+} // removeAttrs args [ "url" "rev" ]) // { inherit rev; }