Merge pull request #18383 from peterhoeg/lw
ledger-web: we have bundlerEnv, let us use it
This commit is contained in:
commit
526746d874
1 changed files with 18 additions and 41 deletions
|
@ -1,48 +1,25 @@
|
||||||
{ stdenv, lib, fetchFromGitHub, bundlerEnv, ruby
|
{ lib, bundlerEnv, ruby
|
||||||
, withPostgresql ? true, postgresql
|
, withPostgresql ? true, postgresql
|
||||||
, withSqlite ? false, sqlite
|
, withSqlite ? false, sqlite
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
bundlerEnv rec {
|
||||||
_name = "ledger-web";
|
name = "ledger-web-${version}";
|
||||||
cmd = "ledger_web";
|
|
||||||
|
|
||||||
env = bundlerEnv {
|
version = (import gemset).ledger_web.version;
|
||||||
name = "${_name}-env";
|
inherit ruby;
|
||||||
inherit ruby;
|
gemfile = ./Gemfile;
|
||||||
gemfile = ./Gemfile;
|
lockfile = ./Gemfile.lock;
|
||||||
lockfile = ./Gemfile.lock;
|
gemset = ./gemset.nix;
|
||||||
gemset = ./gemset.nix;
|
|
||||||
meta = with lib; {
|
buildInputs = lib.optional withPostgresql postgresql
|
||||||
homepage = https://github.com/peterkeen/ledger-web;
|
++ lib.optional withSqlite sqlite;
|
||||||
platforms = platforms.linux;
|
|
||||||
maintainers = [ peterhoeg ];
|
meta = with lib; {
|
||||||
license = licenses.mit;
|
description = "A web frontend to the Ledger CLI tool";
|
||||||
};
|
homepage = https://github.com/peterkeen/ledger-web;
|
||||||
|
license = licenses.mit;
|
||||||
|
maintainers = with maintainers; [ peterhoeg ];
|
||||||
|
platforms = platforms.linux;
|
||||||
};
|
};
|
||||||
|
|
||||||
in stdenv.mkDerivation rec {
|
|
||||||
name = "${_name}-${version}";
|
|
||||||
version = "1.5.2";
|
|
||||||
|
|
||||||
buildInputs = [ env ruby ]
|
|
||||||
++ lib.optional withPostgresql postgresql
|
|
||||||
++ lib.optional withSqlite sqlite;
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "peterkeen";
|
|
||||||
repo = _name;
|
|
||||||
rev = "v${version}";
|
|
||||||
sha256 = "0an4d46h3pp7a8s96jl0dnw1imwdgnb2j474b9wrbidwc6cmfrm7";
|
|
||||||
};
|
|
||||||
|
|
||||||
dontStrip = true;
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
|
|
||||||
cp --no-preserve=mode -r lib $out
|
|
||||||
|
|
||||||
ln -s ${env}/bin/${cmd} $out/bin/${cmd}
|
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue