nixpkgs/pkgs/applications/networking/cluster/panamax/ui/default.nix

73 lines
2.1 KiB
Nix
Raw Normal View History

2015-02-07 15:26:16 +01:00
{ stdenv, fetchgit, fetchurl, makeWrapper, bundlerEnv, bundler_HEAD
2015-01-07 02:40:55 +01:00
, ruby, rubygemsFun, openssl, sqlite, dataDir ? "/var/lib/panamax-ui"}:
2014-12-08 10:02:57 +01:00
2015-01-07 02:40:55 +01:00
with stdenv.lib;
2014-12-08 10:02:57 +01:00
2015-03-18 14:12:13 +01:00
stdenv.mkDerivation rec {
name = "panamax-ui-${version}";
version = "0.2.14";
2015-02-07 15:26:16 +01:00
env = bundlerEnv {
2015-03-18 14:12:13 +01:00
name = "panamax-ui-gems-${version}";
2015-02-07 15:26:16 +01:00
inherit ruby;
2015-03-18 14:12:13 +01:00
gemset = ./gemset.nix;
gemfile = ./Gemfile;
lockfile = ./Gemfile.lock;
buildInputs = [ openssl ];
2015-02-07 15:26:16 +01:00
};
2015-03-18 14:12:13 +01:00
2015-02-07 15:26:16 +01:00
bundler = bundler_HEAD.override { inherit ruby; };
2014-12-08 10:02:57 +01:00
2015-01-07 02:40:55 +01:00
src = fetchgit {
rev = "refs/tags/v${version}";
url = "git://github.com/CenturyLinkLabs/panamax-ui";
2015-03-18 14:12:13 +01:00
sha256 = "0vwy0gazfx3zkf2bx862jspidgn5p97d3jaq99x38qfhxp554sn9";
2015-01-07 02:40:55 +01:00
};
2014-12-08 10:02:57 +01:00
2015-02-07 15:26:16 +01:00
buildInputs = [ makeWrapper env.ruby openssl sqlite bundler ];
2014-12-08 10:02:57 +01:00
2015-01-07 02:40:55 +01:00
setSourceRoot = ''
mkdir -p $out/share
2015-02-07 15:26:16 +01:00
cp -R panamax-ui $out/share/panamax-ui
2015-01-07 02:40:55 +01:00
export sourceRoot="$out/share/panamax-ui"
'';
2014-12-08 10:02:57 +01:00
2015-01-07 02:40:55 +01:00
postPatch = ''
find . -type f -iname "*.haml" -exec sed -e 's|CoreOS Journal|NixOS Journal|g' -i "{}" \;
find . -type f -iname "*.haml" -exec sed -e 's|CoreOS Local|NixOS Local|g' -i "{}" \;
find . -type f -iname "*.haml" -exec sed -e 's|CoreOS Host|NixOS Host|g' -i "{}" \;
sed -e 's|CoreOS Local|NixOS Local|g' -i "spec/features/manage_application_spec.rb"
2014-12-08 10:02:57 +01:00
'';
2015-01-07 02:40:55 +01:00
configurePhase = ''
export HOME=$PWD
2015-02-07 15:26:16 +01:00
export GEM_HOME=${env}/${env.ruby.gemPath}
2015-01-07 02:40:55 +01:00
'';
2014-12-08 10:02:57 +01:00
2015-01-07 02:40:55 +01:00
buildPhase = ''
rm -f ./bin/*
2015-02-07 15:26:16 +01:00
bundle exec rake rails:update:bin
2015-01-07 02:40:55 +01:00
'';
2014-12-08 10:02:57 +01:00
2015-01-07 02:40:55 +01:00
installPhase = ''
rm -rf log tmp db
ln -sf ${dataDir}/{db,state/log,state/tmp} .
mkdir -p $out/bin
makeWrapper bin/bundle "$out/bin/bundle" \
--run "cd $out/share/panamax-ui" \
2015-02-07 15:26:16 +01:00
--prefix "PATH" : "$out/share/panamax-ui/bin:${env.ruby}/bin:$PATH" \
2015-01-07 02:40:55 +01:00
--prefix "HOME" : "$out/share/panamax-ui" \
2015-02-07 15:26:16 +01:00
--prefix "GEM_HOME" : "${env}/${env.ruby.gemPath}" \
--prefix "GEM_PATH" : "$out/share/panamax-ui:${bundler}/${env.ruby.gemPath}"
2015-01-07 02:40:55 +01:00
'';
meta = with stdenv.lib; {
homepage = https://github.com/CenturyLinkLabs/panamax-ui;
description = "The Web GUI for Panamax";
license = licenses.asl20;
maintainers = with maintainers; [ matejc offline ];
platforms = platforms.linux;
};
}