flake.nix (1787B)
1 { 2 description = "A pure Haskell Poly1305 message authentication code."; 3 4 inputs = { 5 ppad-base16 = { 6 type = "git"; 7 url = "git://git.ppad.tech/base16.git"; 8 ref = "master"; 9 inputs.ppad-nixpkgs.follows = "ppad-nixpkgs"; 10 }; 11 ppad-nixpkgs = { 12 type = "git"; 13 url = "git://git.ppad.tech/nixpkgs.git"; 14 ref = "master"; 15 }; 16 flake-utils.follows = "ppad-nixpkgs/flake-utils"; 17 nixpkgs.follows = "ppad-nixpkgs/nixpkgs"; 18 }; 19 20 outputs = { self, nixpkgs, flake-utils, ppad-nixpkgs 21 , ppad-base16 22 }: 23 flake-utils.lib.eachDefaultSystem (system: 24 let 25 lib = "ppad-poly1305"; 26 27 pkgs = import nixpkgs { inherit system; }; 28 hlib = pkgs.haskell.lib; 29 30 hpkgs = pkgs.haskell.packages.ghc981.extend (new: old: { 31 ${lib} = old.callCabal2nixWithOptions lib ./. "--enable-profiling" {}; 32 ppad-base16 = ppad-base16.packages.${system}.default; 33 }); 34 35 cc = pkgs.stdenv.cc; 36 ghc = hpkgs.ghc; 37 cabal = hpkgs.cabal-install; 38 in 39 { 40 packages.default = hpkgs.${lib}; 41 42 devShells.default = hpkgs.shellFor { 43 packages = p: [ 44 (hlib.doBenchmark p.${lib}) 45 ]; 46 47 buildInputs = [ 48 cabal 49 cc 50 ]; 51 52 inputsFrom = builtins.attrValues self.packages.${system}; 53 54 doBenchmark = true; 55 56 shellHook = '' 57 PS1="[${lib}] \w$ " 58 echo "entering ${system} shell, using" 59 echo "cc: $(${cc}/bin/cc --version)" 60 echo "ghc: $(${ghc}/bin/ghc --version)" 61 echo "cabal: $(${cabal}/bin/cabal --version)" 62 ''; 63 }; 64 } 65 ); 66 } 67