1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-13 16:15:30 +00:00
nixpkgs/pkgs/applications/networking/ipfs/default.nix
Luflosi b75e431454
ipfs: 0.6.0 -> 0.7.0
https://github.com/ipfs/go-ipfs/releases/tag/v0.7.0

Pinning go114 is no longer necessary with this version.
2020-09-23 12:58:13 +02:00

46 lines
1.3 KiB
Nix

{ stdenv, buildGoModule, fetchurl, nixosTests }:
buildGoModule rec {
pname = "ipfs";
version = "0.7.0";
rev = "v${version}";
# 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";
sha256 = "1fkzwm4qxxpmbjammk6s5qcyjxivfa0ydqz4mpz1w756c4jq0jf3";
};
# tarball contains multiple files/directories
postUnpack = ''
mkdir ipfs-src
shopt -s extglob
mv !(ipfs-src) ipfs-src || true
cd ipfs-src
'';
sourceRoot = ".";
subPackages = [ "cmd/ipfs" ];
passthru.tests.ipfs = nixosTests.ipfs;
vendorSha256 = null;
postInstall = ''
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
substituteInPlace $out/etc/systemd/system/ipfs.service \
--replace /usr/bin/ipfs $out/bin/ipfs
'';
meta = with stdenv.lib; {
description = "A global, versioned, peer-to-peer filesystem";
homepage = "https://ipfs.io/";
license = licenses.mit;
platforms = platforms.unix;
maintainers = with maintainers; [ fpletz ];
};
}