bundlerUpdateScript: init and use (#64822)

This commit is contained in:
Nick Novitski
2019-07-22 12:02:47 +00:00
committed by zimbatm
parent b24841dd22
commit 7136e0d0a6
79 changed files with 310 additions and 249 deletions
@@ -13,6 +13,7 @@
, document ? []
, meta ? {}
, ignoreCollisions ? false
, passthru ? {}
, ...
}@args:
@@ -55,5 +56,5 @@ in
passthru = basicEnv.passthru // {
inherit basicEnv;
inherit (basicEnv) env;
};
} // passthru;
})
@@ -0,0 +1,25 @@
{ runtimeShell, lib, writeScript, bundix, bundler, bundler-audit, coreutils, git, nix }:
attrPath:
let
updateScript = writeScript "bundler-update-script" ''
#!${runtimeShell}
PATH=${lib.makeBinPath [ bundler bundler-audit bundix coreutils git nix ]}
set -o errexit
set -o nounset
set -o pipefail
attrPath=$1
toplevel=$(git rev-parse --show-toplevel)
position=$(nix eval -f "$toplevel" --raw "$attrPath.meta.position")
gemdir=$(dirname "$position")
cd "$gemdir"
bundler lock --update
bundler-audit check --update
bundix
'';
in [ updateScript attrPath ]
@@ -1,15 +1,17 @@
{ lib, bundlerApp }:
{ lib, bundlerApp, bundlerUpdateScript }:
bundlerApp rec {
pname = "solargraph";
exes = ["solargraph" "solargraph-runtime"];
gemdir = ./.;
passthru.updateScript = bundlerUpdateScript "solargraph";
meta = with lib; {
description = "IDE tools for the Ruby language";
homepage = http://www.github.com/castwide/solargraph;
license = licenses.mit;
maintainers = with maintainers; [ worldofpeace ];
maintainers = with maintainers; [ worldofpeace nicknovitski ];
platforms = platforms.unix;
};
}