bech32

Pure Haskell bech32, bech32m encoding/decoding (docs.ppad.tech/bech32).
git clone git://git.ppad.tech/bech32.git
Log | Files | Refs | README | LICENSE

flake.nix (1512B)


      1 {
      2   description = "Pure Haskell bech32m and bech32 encoding/decoding.";
      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-bech32";
     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         cc    = pkgs.stdenv.cc;
     27         ghc   = hpkgs.ghc;
     28         cabal = hpkgs.cabal-install;
     29       in
     30         {
     31           packages.default = hpkgs.${lib};
     32 
     33           devShells.default = hpkgs.shellFor {
     34             packages = p: [
     35               (hlib.doBenchmark p.${lib})
     36             ];
     37 
     38             buildInputs = [
     39               cabal
     40               cc
     41             ];
     42 
     43             inputsFrom = builtins.attrValues self.packages.${system};
     44 
     45             doBenchmark = true;
     46 
     47             shellHook = ''
     48               PS1="[${lib}] \w$ "
     49               echo "entering ${system} shell, using"
     50               echo "cc:    $(${cc}/bin/cc --version)"
     51               echo "ghc:   $(${ghc}/bin/ghc --version)"
     52               echo "cabal: $(${cabal}/bin/cabal --version)"
     53             '';
     54           };
     55         }
     56       );
     57 }
     58