diff options
author | Ben Sima <ben@bsima.me> | 2019-12-25 11:54:52 -0800 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2019-12-25 11:56:32 -0800 |
commit | c5053414c9a166ceee81245f2a35e792e71fae1a (patch) | |
tree | 37077c9e521a07ab6e1c5bed92e428d0e47e05c5 /nixos-pin | |
parent | 83badd89ebc16a8b1f7e4b2535f21a411c86a0f9 (diff) |
add usage
Diffstat (limited to 'nixos-pin')
-rwxr-xr-x | nixos-pin | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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) |