2020-12-12 09:29:40 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, bzip2
|
|
|
|
, nix
|
|
|
|
, perl
|
|
|
|
, makeWrapper
|
|
|
|
, nixosTests
|
2016-06-13 22:26:36 +02:00
|
|
|
}:
|
2014-12-14 02:18:14 +01:00
|
|
|
|
2021-01-15 10:19:50 +01:00
|
|
|
with lib;
|
2016-06-13 22:26:36 +02:00
|
|
|
|
|
|
|
let
|
2018-03-20 17:40:35 +01:00
|
|
|
rev = "e4675e38ab54942e351c7686e40fabec822120b9";
|
|
|
|
sha256 = "1wm24p6pkxl1d7hrvf4ph6mwzawvqi22c60z9xzndn5xfyr4v0yr";
|
2016-06-13 22:26:36 +02:00
|
|
|
in
|
2014-12-14 02:18:14 +01:00
|
|
|
|
2019-08-13 23:52:01 +02:00
|
|
|
stdenv.mkDerivation {
|
2021-07-27 20:35:51 +02:00
|
|
|
pname = "nix-serve";
|
|
|
|
version = "0.2-${substring 0 7 rev}";
|
2014-12-14 02:18:14 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "edolstra";
|
|
|
|
repo = "nix-serve";
|
2016-06-13 22:26:36 +02:00
|
|
|
inherit rev sha256;
|
2014-12-14 02:18:14 +01:00
|
|
|
};
|
|
|
|
|
2019-04-21 21:27:55 +02:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2014-12-14 02:18:14 +01:00
|
|
|
|
2016-06-13 22:26:36 +02:00
|
|
|
dontBuild = true;
|
2014-12-14 02:18:14 +01:00
|
|
|
|
2016-05-04 12:08:35 +02:00
|
|
|
installPhase = ''
|
2019-04-21 21:27:55 +02:00
|
|
|
install -Dm0755 nix-serve.psgi $out/libexec/nix-serve/nix-serve.psgi
|
|
|
|
|
|
|
|
makeWrapper ${perl.withPackages(p: [ p.DBDSQLite p.Plack p.Starman nix.perl-bindings ])}/bin/starman $out/bin/nix-serve \
|
|
|
|
--prefix PATH : "${makeBinPath [ bzip2 nix ]}" \
|
|
|
|
--add-flags $out/libexec/nix-serve/nix-serve.psgi
|
2016-05-04 12:08:35 +02:00
|
|
|
'';
|
2014-12-14 02:18:14 +01:00
|
|
|
|
2020-12-12 09:29:40 +01:00
|
|
|
passthru.tests.nix-serve = nixosTests.nix-serve;
|
|
|
|
|
2014-12-14 02:18:14 +01:00
|
|
|
meta = {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/edolstra/nix-serve";
|
2014-12-14 02:18:14 +01:00
|
|
|
description = "A utility for sharing a Nix store as a binary cache";
|
2016-06-16 15:51:22 +02:00
|
|
|
maintainers = [ maintainers.eelco ];
|
2019-11-17 14:14:56 +01:00
|
|
|
license = licenses.lgpl21;
|
2014-12-14 02:18:14 +01:00
|
|
|
platforms = nix.meta.platforms;
|
|
|
|
};
|
|
|
|
}
|