fixed

Pure Haskell large fixed-width integers.
git clone git://git.ppad.tech/fixed.git
Log | Files | Refs | README | LICENSE

flake.nix (1555B)


      1 {
      2   description = "Fixed-width integer types.";
      3 
      4   inputs = {
      5     ppad-nixpkgs = {
      6       type = "git";
      7       url  = "git://git.ppad.tech/nixpkgs.git";
      8       ref  = "master";
      9     };
     10     flake-utils.follows = "ppad-nixpkgs/flake-utils";
     11     nixpkgs.follows = "ppad-nixpkgs/nixpkgs";
     12   };
     13 
     14   outputs = { self, nixpkgs, flake-utils, ppad-nixpkgs }:
     15     flake-utils.lib.eachDefaultSystem (system:
     16       let
     17         lib = "ppad-fixed";
     18 
     19         pkgs = import nixpkgs { inherit system; };
     20         hlib = pkgs.haskell.lib;
     21 
     22         hpkgs = pkgs.haskell.packages.ghc981.extend (new: old: {
     23           ${lib} = old.callCabal2nixWithOptions lib ./. "--enable-profiling" {};
     24         });
     25 
     26         cabal = hpkgs.cabal-install;
     27         cc    = pkgs.stdenv.cc;
     28         ghc   = hpkgs.ghc;
     29         llvm  = pkgs.llvmPackages_15.llvm;
     30       in
     31         {
     32           packages.default = hpkgs.${lib};
     33 
     34           devShells.default = hpkgs.shellFor {
     35             packages = p: [
     36               (hlib.doBenchmark p.${lib})
     37             ];
     38 
     39             buildInputs = [
     40               cabal
     41               cc
     42               llvm
     43             ];
     44 
     45             doBenchmark = true;
     46 
     47             shellHook = ''
     48               PS1="[${lib}] \w$ "
     49               echo "entering ${system} shell, using"
     50               echo "cabal: $(${cabal}/bin/cabal --version)"
     51               echo "cc:    $(${cc}/bin/cc --version)"
     52               echo "ghc:   $(${ghc}/bin/ghc --version)"
     53               echo "llc:   $(${llvm}/bin/llc --version | head -2 | tail -1)"
     54             '';
     55           };
     56         }
     57       );
     58 }
     59