Files
nixpkgs/pkgs/development/ruby-modules/bundler-update-script/default.nix
sternenseemann 38ffd641e0 bundlerUpdateScript: use Nix 2.3
The script assumes that nix(1) can be used without any flags which
is no longer the case. We can easily use Nix 2.3 as a workaround
until someone else musters the willpower to adjust this script for
Nix 2.11.
2022-11-29 23:25:42 +01:00

26 lines
622 B
Nix

{ runtimeShell, lib, writeScript, bundix, bundler, bundler-audit, coreutils, git, nix_2_3 }:
attrPath:
let
updateScript = writeScript "bundler-update-script" ''
#!${runtimeShell}
PATH=${lib.makeBinPath [ bundler bundler-audit bundix coreutils git nix_2_3 ]}
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 ]