2021-01-31 18:14:26 +00:00
|
|
|
{ buildGoModule, fetchurl, fetchFromGitHub, lib }:
|
2017-12-15 04:18:33 +00:00
|
|
|
|
2019-09-05 21:59:09 +01:00
|
|
|
let
|
|
|
|
gouiJS = fetchurl {
|
|
|
|
url = "https://storage.googleapis.com/perkeep-release/gopherjs/goui.js";
|
|
|
|
sha256 = "0xbkdpd900gnmzj8p0x38dn4sv170pdvgzcvzsq70s80p6ykkh6g";
|
|
|
|
};
|
|
|
|
|
|
|
|
publisherJS = fetchurl {
|
|
|
|
url = "https://storage.googleapis.com/perkeep-release/gopherjs/publisher.js";
|
|
|
|
sha256 = "09hd7p0xscqnh612jbrjvh3njmlm4292zd5sbqx2lg0aw688q8p2";
|
|
|
|
};
|
|
|
|
|
2021-01-31 18:14:26 +00:00
|
|
|
packages = [
|
|
|
|
"perkeep.org/server/perkeepd"
|
|
|
|
"perkeep.org/cmd/pk"
|
|
|
|
"perkeep.org/cmd/pk-get"
|
|
|
|
"perkeep.org/cmd/pk-put"
|
|
|
|
"perkeep.org/cmd/pk-mount"
|
|
|
|
];
|
|
|
|
|
|
|
|
in buildGoModule rec {
|
|
|
|
pname = "perkeep";
|
|
|
|
version = "0.11";
|
2017-12-15 04:18:33 +00:00
|
|
|
|
2019-09-05 21:59:09 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "perkeep";
|
|
|
|
repo = "perkeep";
|
2021-01-31 18:14:26 +00:00
|
|
|
rev = version;
|
|
|
|
sha256 = "07j5gplk4kcrbazyg4m4bwggzlz5gk89h90r14jvfcpms7v5nrll";
|
2017-12-15 04:18:33 +00:00
|
|
|
};
|
|
|
|
|
2021-01-31 18:14:26 +00:00
|
|
|
vendorSha256 = "1af9a6r9qfrak0n5xyv9z8n7gn7xw2sdjn4s9bwwidkrdm81iq6b";
|
|
|
|
deleteVendor = true; # Vendor is out of sync with go.mod
|
2017-12-15 04:18:33 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
2021-01-31 18:14:26 +00:00
|
|
|
cd "$NIX_BUILD_TOP/source"
|
2019-09-05 21:59:09 +01:00
|
|
|
|
|
|
|
# Skip network fetches
|
|
|
|
cp ${publisherJS} app/publisher/publisher.js
|
|
|
|
cp ${gouiJS} server/perkeepd/ui/goui.js
|
|
|
|
|
2021-01-31 18:14:26 +00:00
|
|
|
go run make.go -offline=true -targets=${lib.concatStringsSep "," packages}
|
2017-12-15 04:18:33 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-31 18:14:26 +00:00
|
|
|
# genfileembed gets built regardless of -targets, to embed static
|
|
|
|
# content into the Perkeep binaries. Remove it in post-install to
|
|
|
|
# avoid polluting paths.
|
2018-07-20 07:28:24 +01:00
|
|
|
postInstall = ''
|
2021-01-31 18:14:26 +00:00
|
|
|
rm -f $out/bin/genfileembed
|
2017-12-15 04:18:33 +00:00
|
|
|
'';
|
|
|
|
|
2018-07-20 07:28:24 +01:00
|
|
|
meta = with lib; {
|
2017-12-15 04:18:33 +00:00
|
|
|
description = "A way of storing, syncing, sharing, modelling and backing up content (née Camlistore)";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://perkeep.org";
|
2017-12-15 04:18:33 +00:00
|
|
|
license = licenses.asl20;
|
2021-01-31 18:14:26 +00:00
|
|
|
maintainers = with maintainers; [ cstrahan danderson kalbasit ];
|
2017-12-15 04:18:33 +00:00
|
|
|
};
|
|
|
|
}
|