nixpkgs/pkgs/applications/networking/ipfs/default.nix

49 lines
1.5 KiB
Nix
Raw Normal View History

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