From aeb360caa3152f32781a5524a393dfc26d3590d9 Mon Sep 17 00:00:00 2001 From: Joseph Lukasik Date: Thu, 30 Aug 2018 14:06:50 -0700 Subject: [PATCH 1/3] ipfs-cluster: init at 0.5.0 --- .../networking/ipfs-cluster/default.nix | 39 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 40 insertions(+) create mode 100644 pkgs/applications/networking/ipfs-cluster/default.nix diff --git a/pkgs/applications/networking/ipfs-cluster/default.nix b/pkgs/applications/networking/ipfs-cluster/default.nix new file mode 100644 index 00000000000..d073593d488 --- /dev/null +++ b/pkgs/applications/networking/ipfs-cluster/default.nix @@ -0,0 +1,39 @@ +{ stdenv, buildGoPackage, fetchFromGitHub, fetchgx, gx-go }: + +buildGoPackage rec { + name = "ipfs-cluster-${version}"; + version = "0.5.0"; + rev = "v${version}"; + + goPackagePath = "github.com/ipfs/ipfs-cluster"; + + extraSrcPaths = [ + (fetchgx { + inherit name src; + sha256 = "0jwz3kd07i5fs0sxds80j8d338skhgxgxra377qxsk0cr2hhj2vm"; + }) + ]; + + src = fetchFromGitHub { + owner = "ipfs"; + repo = "ipfs-cluster"; + inherit rev; + sha256 = "132whjyplcifq8747hcdrgbc0amhp618dg049jq5nyslcxfgdypm"; + }; + + preBuild = '' + # fetchgx stores packages by their ipfs hash + # this will rewrite github.com/ imports to gx/ipfs/ + cd go/src/${goPackagePath} + ${gx-go}/bin/gx-go rewrite + ''; + + meta = with stdenv.lib; { + description = "Allocate, replicate, and track Pins across a cluster of IPFS daemons"; + homepage = https://cluster.ipfs.io/; + license = licenses.mit; + platforms = platforms.unix; + maintainers = with maintainers; [ jglukasik ]; + }; +} + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 318b1941e9a..4e718f7def3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3307,6 +3307,7 @@ with pkgs; ipfs = callPackage ../applications/networking/ipfs { }; ipfs-migrator = callPackage ../applications/networking/ipfs-migrator { }; + ipfs-cluster = callPackage ../applications/networking/ipfs-cluster { }; ipget = callPackage ../applications/networking/ipget { buildGoPackage = buildGo110Package; From d8b4a46b0eaf33df89dfc9370d965448cd124a72 Mon Sep 17 00:00:00 2001 From: Joseph Lukasik Date: Thu, 30 Aug 2018 15:43:56 -0700 Subject: [PATCH 2/3] Add jglukasik to maintainer-list.nix --- maintainers/maintainer-list.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 1d6d772e7e9..7da5e645f37 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -1862,6 +1862,11 @@ github = "jgillich"; name = "Jakob Gillich"; }; + jglukasik = { + email = "joseph@jgl.me"; + github = "jglukasik"; + name = "Joseph Lukasik"; + }; jhhuh = { email = "jhhuh.note@gmail.com"; github = "jhhuh"; From 314d1fcdcb5b8602d634beaf577757ee5e8b6aee Mon Sep 17 00:00:00 2001 From: Joseph Lukasik Date: Sat, 1 Sep 2018 16:01:43 -0700 Subject: [PATCH 3/3] Add gx-go to nativeBuildInputs for ipfs-cluster --- pkgs/applications/networking/ipfs-cluster/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/ipfs-cluster/default.nix b/pkgs/applications/networking/ipfs-cluster/default.nix index d073593d488..33b9f615139 100644 --- a/pkgs/applications/networking/ipfs-cluster/default.nix +++ b/pkgs/applications/networking/ipfs-cluster/default.nix @@ -21,11 +21,13 @@ buildGoPackage rec { sha256 = "132whjyplcifq8747hcdrgbc0amhp618dg049jq5nyslcxfgdypm"; }; + nativeBuildInputs = [ gx-go ]; + preBuild = '' # fetchgx stores packages by their ipfs hash # this will rewrite github.com/ imports to gx/ipfs/ cd go/src/${goPackagePath} - ${gx-go}/bin/gx-go rewrite + gx-go rewrite ''; meta = with stdenv.lib; {