bip39

BIP39 mnemonic codes in Haskell (docs.ppad.tech/bip39).
git clone git://git.ppad.tech/bip39.git
Log | Files | Refs | README | LICENSE

flake.nix (3049B)


      1 {
      2   description = "Pure Haskell BIP39 hierarchical deterministic wallets.";
      3 
      4   inputs = {
      5     ppad-nixpkgs = {
      6       type = "git";
      7       url  = "git://git.ppad.tech/nixpkgs.git";
      8       ref  = "master";
      9     };
     10     ppad-bip32 = {
     11       type = "git";
     12       url  = "git://git.ppad.tech/bip32.git";
     13       ref  = "master";
     14       inputs.ppad-nixpkgs.follows = "ppad-nixpkgs";
     15       inputs.ppad-base16.follows = "ppad-base16";
     16       inputs.ppad-sha256.follows = "ppad-sha256";
     17       inputs.ppad-sha512.follows = "ppad-sha512";
     18     };
     19     ppad-base16 = {
     20       type = "git";
     21       url  = "git://git.ppad.tech/base16.git";
     22       ref  = "master";
     23       inputs.ppad-nixpkgs.follows = "ppad-nixpkgs";
     24     };
     25     ppad-sha256 = {
     26       type = "git";
     27       url  = "git://git.ppad.tech/sha256.git";
     28       ref  = "master";
     29       inputs.ppad-nixpkgs.follows = "ppad-nixpkgs";
     30     };
     31     ppad-sha512 = {
     32       type = "git";
     33       url  = "git://git.ppad.tech/sha512.git";
     34       ref  = "master";
     35       inputs.ppad-nixpkgs.follows = "ppad-nixpkgs";
     36     };
     37     ppad-pbkdf = {
     38       type = "git";
     39       url  = "git://git.ppad.tech/pbkdf.git";
     40       ref  = "master";
     41       inputs.ppad-nixpkgs.follows = "ppad-nixpkgs";
     42       inputs.ppad-sha256.follows = "ppad-sha256";
     43       inputs.ppad-sha512.follows = "ppad-sha512";
     44     };
     45     flake-utils.follows = "ppad-nixpkgs/flake-utils";
     46     nixpkgs.follows = "ppad-nixpkgs/nixpkgs";
     47   };
     48 
     49   outputs = { self, nixpkgs, flake-utils, ppad-nixpkgs
     50             , ppad-sha256, ppad-sha512
     51             , ppad-base16
     52             , ppad-bip32
     53             , ppad-pbkdf
     54             }:
     55     flake-utils.lib.eachDefaultSystem (system:
     56       let
     57         lib = "ppad-bip39";
     58 
     59         pkgs = import nixpkgs { inherit system; };
     60         hlib = pkgs.haskell.lib;
     61 
     62         hpkgs = pkgs.haskell.packages.ghc981.extend (new: old: {
     63           ${lib} = old.callCabal2nixWithOptions lib ./. "--enable-profiling" {};
     64           ppad-bip32 = ppad-bip32.packages.${system}.default;
     65           ppad-base16 = ppad-base16.packages.${system}.default;
     66           ppad-sha256 = ppad-sha256.packages.${system}.default;
     67           ppad-sha512 = ppad-sha512.packages.${system}.default;
     68           ppad-pbkdf = ppad-pbkdf.packages.${system}.default;
     69         });
     70 
     71         cc    = pkgs.stdenv.cc;
     72         ghc   = hpkgs.ghc;
     73         cabal = hpkgs.cabal-install;
     74       in
     75         {
     76           packages.default = hpkgs.${lib};
     77 
     78           devShells.default = hpkgs.shellFor {
     79             packages = p: [
     80               (hlib.doBenchmark p.${lib})
     81             ];
     82 
     83             buildInputs = [
     84               cabal
     85               cc
     86             ];
     87 
     88             inputsFrom = builtins.attrValues self.packages.${system};
     89 
     90             doBenchmark = true;
     91 
     92             shellHook = ''
     93               PS1="[${lib}] \w$ "
     94               echo "entering ${system} shell, using"
     95               echo "cc:    $(${cc}/bin/cc --version)"
     96               echo "ghc:   $(${ghc}/bin/ghc --version)"
     97               echo "cabal: $(${cabal}/bin/cabal --version)"
     98             '';
     99           };
    100         }
    101       );
    102 }
    103