From c5053414c9a166ceee81245f2a35e792e71fae1a Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 25 Dec 2019 11:54:52 -0800 Subject: add usage --- nixos-pin | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'nixos-pin') 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 " && exit 1 +function usage { + echo "usage: nixos-pin " + echo "where 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) -- cgit v1.2.3