Skip to content

Instantly share code, notes, and snippets.

@masterdezign
Last active July 27, 2020 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masterdezign/1da54876610843077c32309acce32acb to your computer and use it in GitHub Desktop.
Save masterdezign/1da54876610843077c32309acce32acb to your computer and use it in GitHub Desktop.
Hasktorch with Nix
# First of all make sure Nix is up and running https://nixos.org/nix
# Clone Hasktorch
git clone https://github.com/hasktorch/hasktorch.git
cd hasktorch
NIX_PATH="nixpkgs=https://github.com/NixOS/nixpkgs/archive/release-19.09.tar.gz"
nix-env -iA cachix -f https://cachix.org/api/v1/install
cachix use hasktorch
# Option 1: Build examples
nix-build -A hasktorch-examples_cpu
# Run an example application
./result/bin/static-xor-mlp
# Option 2, interactive with Stack
stack --nix ghci
# Option 3 (might be problematic as of 27 July 2020): Launch Jupyter Lab
nix-shell ./nix/jupyter-shell.nix --command "jupyter lab"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment