1{
2 runtimeShell,
3 lib,
4 writeScript,
5 bundix,
6 bundler,
7 coreutils,
8 git,
9 nix,
10 nixfmt,
11}:
12
13attrPath:
14
15let
16 updateScript = writeScript "bundler-update-script" ''
17 #!${runtimeShell}
18 PATH=${
19 lib.makeBinPath [
20 bundler
21 bundix
22 coreutils
23 git
24 nix
25 nixfmt
26 ]
27 }
28 set -o errexit
29 set -o nounset
30 set -o pipefail
31
32 attrPath=$1
33
34 toplevel=$(git rev-parse --show-toplevel)
35 position=$(nix --extra-experimental-features nix-command eval -f "$toplevel" --raw "$attrPath.meta.position")
36 gemdir=$(dirname "$position")
37
38 cd "$gemdir"
39
40 rm -f gemset.nix Gemfile.lock
41 export BUNDLE_FORCE_RUBY_PLATFORM=1
42 bundler lock --update
43 bundix
44 nixfmt gemset.nix
45 '';
46in
47[
48 updateScript
49 attrPath
50]