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