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