on bfbbbd3 help sign in
haskell.nix/scripts/update-external.nix
26 lines 554 B history raw
1{ stdenv, writeScript, glibc, coreutils, git, nix-tools, cabal-install, nix-prefetch-git }:
3{ name, script }:
5with stdenv.lib;
7writeScript "update-${name}-nix.sh" ''
8 #!${stdenv.shell}
10 set -euo pipefail
12 export PATH="${makeBinPath [ coreutils glibc git nix-tools cabal-install nix-prefetch-git ]}"
14 ${script}
16 git add .
17 git commit --allow-empty -m "Automatic update for $(date)"
19 rev=$(git rev-parse HEAD)
21 git push
23 cd ..
25 nix-prefetch-git https://github.com/input-output-hk/${name}.nix.git --rev "$rev" | tee ${name}-src.json
26''