summaryrefslogtreecommitdiff
path: root/nixos-pin
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2019-12-25 11:54:52 -0800
committerBen Sima <ben@bsima.me>2019-12-25 11:56:32 -0800
commitc5053414c9a166ceee81245f2a35e792e71fae1a (patch)
tree37077c9e521a07ab6e1c5bed92e428d0e47e05c5 /nixos-pin
parent83badd89ebc16a8b1f7e4b2535f21a411c86a0f9 (diff)
add usage
Diffstat (limited to 'nixos-pin')
-rwxr-xr-xnixos-pin8
1 files changed, 7 insertions, 1 deletions
diff --git a/nixos-pin b/nixos-pin
index 296073a..7ff2c6a 100755
--- a/nixos-pin
+++ b/nixos-pin
@@ -1,6 +1,12 @@
#!/usr/bin/env bash
-[[ -z $1 ]] && echo "usage: nix-pin <hash>" && exit 1
+function usage {
+ echo "usage: nixos-pin <hash>"
+ echo "where <hash> is a git sha from the nixpkgs repo"
+ exit 1
+}
+
+[[ -z $1 ]] && usage
url="https://github.com/NixOS/nixpkgs/archive/$1.tar.gz"
hash=$(nix-prefetch-url --unpack $url)