1{ runtimeShell, lib, writeScript, bundix, bundler, bundler-audit, coreutils, git, nix }:
2
3attrPath:
4
5let
6 updateScript = writeScript "bundler-update-script" ''
7 #!${runtimeShell}
8 PATH=${lib.makeBinPath [ bundler bundler-audit bundix coreutils git nix ]}
9 set -o errexit
10 set -o nounset
11 set -o pipefail
12
13 attrPath=$1
14
15 toplevel=$(git rev-parse --show-toplevel)
16 position=$(nix eval -f "$toplevel" --raw "$attrPath.meta.position")
17 gemdir=$(dirname "$position")
18
19 cd "$gemdir"
20
21 bundler lock --update
22 bundler-audit check --update
23 bundix
24 '';
25in [ updateScript attrPath ]