Skip to content

Instantly share code, notes, and snippets.

@justinwoo
Last active December 23, 2018 11:47
Show Gist options
  • Save justinwoo/043195b975659099a1b0ea164b77d5fe to your computer and use it in GitHub Desktop.
Save justinwoo/043195b975659099a1b0ea164b77d5fe to your computer and use it in GitHub Desktop.
this derivation always fails for me with nix-build
let
pkgs = import <nixpkgs> {};
name = "psc-package2nix-prefetch-${dep}-${version}";
dep = "simple-json";
repo = "https://github.com/justinwoo/purescript-simple-json.git";
version = "v4.0.0";
in pkgs.runCommand name {
buildInputs = with pkgs; [
nix-prefetch-git
jq
];
} ''
RESULT=$(nix-prefetch-git "${repo}" --rev "${version}" --quiet | jq '.sha256' -r)
if [ $RESULT == '0sjjj9z1dhilhpc8pq4154czrb79z9cm044jvn75kxcjv6v5l2m5' ]; then
echo "Prefetched revision was empty: ${repo} ${version}";
exit 1;
else
echo $RESULT > $out;
fi
''
# always fails with 0sjjj9z1dhilhpc8pq4154czrb79z9cm044jvn75kxcjv6v5l2m5, an empty fetched result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment