flake.nix (1854B)
1 { 2 description = "Primitive Script support for Haskell."; 3 4 inputs = { 5 ppad-nixpkgs = { 6 type = "git"; 7 url = "git://git.ppad.tech/nixpkgs.git"; 8 ref = "master"; 9 }; 10 ppad-base16 = { 11 type = "git"; 12 url = "git://git.ppad.tech/base16.git"; 13 ref = "master"; 14 inputs.ppad-nixpkgs.follows = "ppad-nixpkgs"; 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-script"; 26 27 pkgs = import nixpkgs { inherit system; }; 28 hlib = pkgs.haskell.lib; 29 30 base16 = ppad-base16.packages.${system}.default; 31 32 hpkgs = pkgs.haskell.packages.ghc981.extend (new: old: { 33 ppad-base16 = base16; 34 ${lib} = old.callCabal2nixWithOptions lib ./. "--enable-profiling" { 35 ppad-base16 = new.ppad-base16; 36 }; 37 }); 38 39 cc = pkgs.stdenv.cc; 40 ghc = hpkgs.ghc; 41 cabal = hpkgs.cabal-install; 42 in 43 { 44 packages.default = hpkgs.${lib}; 45 46 devShells.default = hpkgs.shellFor { 47 packages = p: [ 48 (hlib.doBenchmark p.${lib}) 49 ]; 50 51 buildInputs = [ 52 cabal 53 cc 54 ]; 55 56 inputsFrom = builtins.attrValues self.packages.${system}; 57 58 doBenchmark = true; 59 60 shellHook = '' 61 PS1="[${lib}] \w$ " 62 echo "entering ${system} shell, using" 63 echo "cc: $(${cc}/bin/cc --version)" 64 echo "ghc: $(${ghc}/bin/ghc --version)" 65 echo "cabal: $(${cabal}/bin/cabal --version)" 66 ''; 67 }; 68 } 69 ); 70 } 71