2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2017-11-14 11:08:17 +00:00
|
|
|
, pkgs, makeWrapper, buildEnv
|
2019-02-26 11:45:54 +00:00
|
|
|
, nodejs, runtimeShell
|
2017-11-14 11:08:17 +00:00
|
|
|
}:
|
2014-09-20 23:42:15 +00:00
|
|
|
|
2017-11-14 11:08:17 +00:00
|
|
|
let
|
|
|
|
nodePackages = import ./node.nix {
|
|
|
|
inherit pkgs;
|
2018-08-20 19:11:29 +00:00
|
|
|
system = stdenv.hostPlatform.system;
|
2017-11-14 11:08:17 +00:00
|
|
|
};
|
2014-09-20 23:42:15 +00:00
|
|
|
|
2017-11-14 11:08:17 +00:00
|
|
|
runtimeEnv = buildEnv {
|
|
|
|
name = "airfield-runtime";
|
|
|
|
paths = with nodePackages; [
|
|
|
|
nodePackages."express-3.0.5" nodePackages."swig-0.14.0"
|
|
|
|
nodePackages."consolidate-0.10.0" redis connect-redis
|
|
|
|
async request
|
|
|
|
];
|
2014-09-20 23:42:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
name = "airfield-${version}";
|
2017-11-14 11:08:17 +00:00
|
|
|
version = "2015-01-04";
|
|
|
|
|
|
|
|
src = stdenv.mkDerivation {
|
|
|
|
name = "${name}-src";
|
|
|
|
inherit version;
|
2014-09-20 23:42:15 +00:00
|
|
|
|
2017-11-14 11:08:17 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "emblica";
|
|
|
|
repo = "airfield";
|
|
|
|
rev = "f021b19a35be3db9be7780318860f3b528c48641";
|
|
|
|
sha256 = "1xk69x89kgg98hm7c2ysyfmg7pkvgkpg4wym6v5cmdkdid08fsgs";
|
|
|
|
};
|
2014-09-20 23:42:15 +00:00
|
|
|
|
2017-11-14 11:08:17 +00:00
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir $out
|
|
|
|
cp -R . $out
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in stdenv.mkDerivation {
|
|
|
|
inherit name version src;
|
2014-09-20 23:42:15 +00:00
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ nodejs ];
|
2017-11-14 11:08:17 +00:00
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cat >$out/bin/airfield <<EOF
|
2019-02-26 11:45:54 +00:00
|
|
|
#!${runtimeShell}
|
2017-11-14 11:08:17 +00:00
|
|
|
${nodejs}/bin/node ${src}/airfield.js
|
|
|
|
EOF
|
2014-09-20 23:42:15 +00:00
|
|
|
'';
|
|
|
|
|
2017-11-14 11:08:17 +00:00
|
|
|
postFixup = ''
|
|
|
|
chmod +x $out/bin/airfield
|
|
|
|
wrapProgram $out/bin/airfield \
|
|
|
|
--set NODE_PATH "${runtimeEnv}/lib/node_modules"
|
|
|
|
'';
|
2014-09-20 23:42:15 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2015-04-30 15:05:14 +00:00
|
|
|
description = "A web-interface for hipache-proxy";
|
2014-09-20 23:42:15 +00:00
|
|
|
license = licenses.mit;
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/emblica/airfield";
|
2019-12-26 14:13:48 +00:00
|
|
|
maintainers = with maintainers; [ offline ];
|
2015-11-17 20:29:29 +00:00
|
|
|
platforms = platforms.linux;
|
2014-09-20 23:42:15 +00:00
|
|
|
};
|
|
|
|
}
|