2021-01-25 00:26:54 -08:00
|
|
|
{ lib, buildGoModule, fetchurl, nixosTests }:
|
2016-06-05 17:46:06 -07:00
|
|
|
|
2019-06-09 18:47:55 -07:00
|
|
|
buildGoModule rec {
|
|
|
|
pname = "ipfs";
|
2021-02-20 15:03:44 -08:00
|
|
|
version = "0.8.0";
|
2017-10-02 11:35:45 -07:00
|
|
|
rev = "v${version}";
|
2016-06-05 17:46:06 -07:00
|
|
|
|
2020-05-11 00:03:30 -07: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";
|
2021-02-20 15:03:44 -08:00
|
|
|
sha256 = "sha256-uK3+Ekr5AM6mmGmjFSj1Rotm5pbH657BYUlP9B39WEw=";
|
2016-06-05 17:46:06 -07:00
|
|
|
};
|
|
|
|
|
2020-05-11 00:03:30 -07:00
|
|
|
# tarball contains multiple files/directories
|
|
|
|
postUnpack = ''
|
|
|
|
mkdir ipfs-src
|
2020-09-23 03:06:44 -07:00
|
|
|
shopt -s extglob
|
|
|
|
mv !(ipfs-src) ipfs-src || true
|
2020-05-11 00:03:30 -07:00
|
|
|
cd ipfs-src
|
2020-05-07 07:26:09 -07:00
|
|
|
'';
|
|
|
|
|
2020-05-11 00:03:30 -07:00
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
subPackages = [ "cmd/ipfs" ];
|
2020-03-13 12:37:56 -07:00
|
|
|
|
2020-05-08 02:49:10 -07:00
|
|
|
passthru.tests.ipfs = nixosTests.ipfs;
|
2020-05-08 01:34:42 -07:00
|
|
|
|
2020-05-11 00:03:30 -07:00
|
|
|
vendorSha256 = null;
|
2019-06-09 18:47:55 -07:00
|
|
|
|
2020-06-11 11:47:06 -07:00
|
|
|
postInstall = ''
|
2020-09-23 03:01:14 -07: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 11:47:06 -07:00
|
|
|
substituteInPlace $out/etc/systemd/system/ipfs.service \
|
|
|
|
--replace /usr/bin/ipfs $out/bin/ipfs
|
|
|
|
'';
|
|
|
|
|
2021-01-10 23:54:33 -08:00
|
|
|
meta = with lib; {
|
2016-06-05 17:46:06 -07:00
|
|
|
description = "A global, versioned, peer-to-peer filesystem";
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://ipfs.io/";
|
2016-06-05 17:46:06 -07:00
|
|
|
license = licenses.mit;
|
2016-10-28 20:19:41 -07:00
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ fpletz ];
|
2016-06-05 17:46:06 -07:00
|
|
|
};
|
|
|
|
}
|