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
|
||||
, withSqlite ? false, sqlite
|
||||
}:
|
||||
|
||||
let
|
||||
_name = "ledger-web";
|
||||
cmd = "ledger_web";
|
||||
bundlerEnv rec {
|
||||
name = "ledger-web-${version}";
|
||||
|
||||
env = bundlerEnv {
|
||||
name = "${_name}-env";
|
||||
inherit ruby;
|
||||
gemfile = ./Gemfile;
|
||||
lockfile = ./Gemfile.lock;
|
||||
gemset = ./gemset.nix;
|
||||
meta = with lib; {
|
||||
homepage = https://github.com/peterkeen/ledger-web;
|
||||
platforms = platforms.linux;
|
||||
maintainers = [ peterhoeg ];
|
||||
license = licenses.mit;
|
||||
};
|
||||
version = (import gemset).ledger_web.version;
|
||||
inherit ruby;
|
||||
gemfile = ./Gemfile;
|
||||
lockfile = ./Gemfile.lock;
|
||||
gemset = ./gemset.nix;
|
||||
|
||||
buildInputs = lib.optional withPostgresql postgresql
|
||||
++ lib.optional withSqlite sqlite;
|
||||
|
||||
meta = with lib; {
|
||||
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