summaryrefslogtreecommitdiffstats
path: root/krebs/update-nixpkgs-unstable.sh
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/update-nixpkgs-unstable.sh')
-rwxr-xr-xkrebs/update-nixpkgs-unstable.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/krebs/update-nixpkgs-unstable.sh b/krebs/update-nixpkgs-unstable.sh
new file mode 100755
index 000000000..068da5f6f
--- /dev/null
+++ b/krebs/update-nixpkgs-unstable.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+dir=$(dirname $0)
+oldrev=$(cat $dir/nixpkgs-unstable.json | jq -r .rev | sed 's/\(.\{7\}\).*/\1/')
+nix-shell -p nix-prefetch-git --run 'nix-prefetch-git \
+ --url https://github.com/NixOS/nixpkgs-channels \
+ --rev refs/heads/nixos-unstable' \
+> $dir/nixpkgs-unstable.json
+newrev=$(cat $dir/nixpkgs-unstable.json | jq -r .rev | sed 's/\(.\{7\}\).*/\1/')
+git commit $dir/nixpkgs.json -m "nixpkgs-unstable: $oldrev -> $newrev"