2020-05-11 10:03:30 +03:00
|
|
|
{ stdenv, buildGoModule, fetchurl, nixosTests }:
|
2016-06-06 03:46:06 +03:00
|
|
|
|
2019-06-10 04:47:55 +03:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "ipfs";
|
2020-06-20 03:14:04 +03:00
|
|
|
version = "0.6.0";
|
2017-10-02 21:35:45 +03:00
|
|
|
rev = "v${version}";
|
2016-06-06 03:46:06 +03:00
|
|
|
|
2020-05-11 10:03:30 +03:00
|
|
|
# go-ipfs makes changes to it's source tarball that don't match the git source.
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/ipfs/go-ipfs/releases/download/${rev}/go-ipfs-source.tar.gz";
|
2020-06-20 03:14:04 +03:00
|
|
|
sha256 = "14bgq2j2bjjy0pspy2lsj5dm3w9rmfha0l8kyq5ig86yhc4nzn80";
|
2016-06-06 03:46:06 +03:00
|
|
|
};
|
|
|
|
|
2020-05-11 10:03:30 +03:00
|
|
|
# tarball contains multiple files/directories
|
|
|
|
postUnpack = ''
|
|
|
|
mkdir ipfs-src
|
|
|
|
mv * ipfs-src || true
|
|
|
|
cd ipfs-src
|
2020-05-07 17:26:09 +03:00
|
|
|
'';
|
|
|
|
|
2020-05-11 10:03:30 +03:00
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
subPackages = [ "cmd/ipfs" ];
|
2020-03-13 22:37:56 +03:00
|
|
|
|
2020-05-08 12:49:10 +03:00
|
|
|
passthru.tests.ipfs = nixosTests.ipfs;
|
2020-05-08 11:34:42 +03:00
|
|
|
|
2020-05-11 10:03:30 +03:00
|
|
|
vendorSha256 = null;
|
2019-06-10 04:47:55 +03:00
|
|
|
|
2020-06-11 21:47:06 +03:00
|
|
|
postInstall = ''
|
2020-09-23 13:01:14 +03:00
|
|
|
install --mode=444 -D misc/systemd/ipfs.service $out/etc/systemd/system/ipfs.service
|
|
|
|
install --mode=444 -D misc/systemd/ipfs-api.socket $out/etc/systemd/system/ipfs-api.socket
|
|
|
|
install --mode=444 -D misc/systemd/ipfs-gateway.socket $out/etc/systemd/system/ipfs-gateway.socket
|
2020-06-11 21:47:06 +03:00
|
|
|
substituteInPlace $out/etc/systemd/system/ipfs.service \
|
|
|
|
--replace /usr/bin/ipfs $out/bin/ipfs
|
|
|
|
'';
|
|
|
|
|
2016-06-06 03:46:06 +03:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A global, versioned, peer-to-peer filesystem";
|
2020-04-01 04:11:51 +03:00
|
|
|
homepage = "https://ipfs.io/";
|
2016-06-06 03:46:06 +03:00
|
|
|
license = licenses.mit;
|
2016-10-29 06:19:41 +03:00
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ fpletz ];
|
2016-06-06 03:46:06 +03:00
|
|
|
};
|
|
|
|
}
|