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