cryptopals

Matasano's cryptopals challenges (cryptopals.com).
git clone git://git.jtobin.io/cryptopals.git
Log | Files | Refs | README | LICENSE

default.nix (854B)


      1 let
      2   revision = "5717cbc076d996e6c07b16706073f09e021d0b99";
      3 
      4   tarball = owner: repo: rev:
      5     builtins.fetchTarball {
      6       url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz";
      7     };
      8 
      9   compilerSet = pkgs.haskell.packages."ghc902";
     10 
     11   pkgs = import (tarball "NixOS" "nixpkgs" revision) { inherit config; };
     12   ignore = pkgs.nix-gitignore.gitignoreSourcePure;
     13 
     14   config = {
     15     packageOverrides = super: let self = super.pkgs; in rec {
     16       haskell = super.haskell // {
     17         packageOverrides = self: super: {
     18           cryptopals = super.callCabal2nix "cryptopals"
     19                       (ignore [./.gitignore] ./.) {};
     20         };
     21       };
     22     };
     23   };
     24 
     25 in
     26   {
     27     inherit pkgs;
     28     shell = compilerSet.shellFor {
     29       packages = p: [p.cryptopals];
     30       buildInputs = with pkgs; [
     31         compilerSet.cabal-install
     32       ];
     33     };
     34   }