Created
June 16, 2020 17:59
-
-
Save jefdaj/3f1f6d9581561e114a4f264acc642434 to your computer and use it in GitHub Desktop.
nix-shell for http://www.cs.man.ac.uk/~david/categories/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with import <nixpkgs> {}; | |
stdenv.mkDerivation { | |
name = "computational-category-theory"; | |
buildInputs = [ | |
smlnj | |
]; | |
shellHook = '' | |
cd programs | |
sml | |
exit | |
''; | |
} |
At the moment I am using this to also fetch the code. It is not exactly pure, since I should be checking that the hash of the result is the same but eh.
let
pkgs = import (fetchTarball {
url =
"https://github.com/NixOS/nixpkgs-channels/archive/0a146054bdf6f70f66de4426f84c9358521be31e.tar.gz";
sha256 = "154ypjfhy9qqa0ww6xi7d8280h85kffqaqf6b6idymizga9ckjcd";
}) { config = { allowUnfree = true; }; };
optional = pkgs.lib.lists.optional;
get-programs = pkgs.writeShellScript "get-programs" ''
if [ ! -f "Readme" ]; then
${pkgs.wget}/bin/wget \
--recursive \
--no-parent \
-e robots=off \
--reject="index.html*" \
--cut-dirs=3 \
-nH \
"http://www.cs.man.ac.uk/~david/categories/programs/"
fi
'';
in with pkgs;
stdenv.mkDerivation {
name = "computational-category-theory";
nativeBuildInputs = [ get-programs ];
buildInputs = optional stdenv.isLinux smlnj ;
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Download the programs directory, put
default.nix
in the dir above it, and launchnix-shell
from there. Or put all files in the same dir and remove thecd
line.