diff options
author | Ben Sima <ben@bsima.me> | 2019-08-29 06:25:12 -0700 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2019-08-29 06:25:12 -0700 |
commit | d105e6a7394cfa9635141d4f60da3f300678df0d (patch) | |
tree | 3f1cb130fa4770a93e03d25b9626dd7cdec5f05c | |
parent | 161730ed73261bcf2bc73b943c4b84184ae3d057 (diff) |
add nix-pin
-rwxr-xr-x | nix-pin | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +[[ -z $1 ]] && echo "usage: nix-pin <hash>" && exit 1 + +url="https://github.com/NixOS/nixpkgs/archive/$1.tar.gz" +hash=$(nix-prefetch-url --unpack $url) + +cat <<EOF +# generated with ~/bin/nix-pin +{ + url = "$url"; + sha256 = "$hash"; +} +EOF |