Skip to content

Commit

Permalink
Update to new version of hs-web3 and GHC 9.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenAstudillo committed Aug 31, 2022
1 parent b87edf4 commit 4866b6b
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 28 deletions.
4 changes: 2 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{ mkDerivation, base, generics-sop, hpack, lib, zlib }:
{ mkDerivation, base, generics-sop, hpack, lib, zlib, web3 }:
mkDerivation {
pname = "pixura-contracts";
version = "0.3.0.0";
src = ./.;
libraryHaskellDepends = [ base generics-sop ];
libraryHaskellDepends = [ base generics-sop web3 ];
libraryPkgconfigDepends = [ zlib ];
libraryToolDepends = [ hpack ];
prePatch = "hpack";
Expand Down
41 changes: 37 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 28 additions & 18 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,38 +1,48 @@
{
# inspired by: https://serokell.io/blog/practical-nix-flakes#packaging-existing-applications
description = "A Hello World in Haskell with a dependency and a devShell";
inputs.nixpkgs.url = "nixpkgs";
outputs = { self, nixpkgs }:
inputs =
{
nixpkgs.url = "nixpkgs";
hs-web3 =
{ url = "hs-web3";
inputs.nixpkgs.url = "nixpkgs";
};
};
outputs = { self, nixpkgs, hs-web3 }:
let
supportedSystems = [ "x86_64-linux" "x86_64-darwin" ];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
nixpkgsFor = forAllSystems (system: import nixpkgs {
inherit system;
overlays = [ self.overlay ];
overlays = [ (self.overlay system) ];
});
in
{
overlay = (final: prev: {
pixura-contracts = final.haskell.packages.ghc923.callPackage (import ./default.nix) {
overlay = (system: final: prev: {
pixura-contracts = final.haskell.packages.ghc924.callPackage (import ./default.nix) {
inherit (final) zlib;
inherit (hs-web3.packages.${system}) web3;
};
});
packages = forAllSystems (system: {
pixura-contracts = nixpkgsFor.${system}.pixura-contracts;
});
defaultPackage = forAllSystems (system: self.packages.${system}.pixura-contracts);
checks = self.packages;
devShell = forAllSystems (system: let haskellPackages = nixpkgsFor.${system}.haskell.packages.ghc923;
in haskellPackages.shellFor {
packages = p: [self.packages.${system}.pixura-contracts];
withHoogle = true;
buildInputs = with haskellPackages; [
haskell-language-server
ghcid
cabal-install
];
# Change the prompt to show that you are in a devShell
# shellHook = "export PS1='\\e[1;34mdev > \\e[0m'";
});
};
devShell = forAllSystems (system:
let haskellPackages = nixpkgsFor.${system}.haskell.packages.ghc924;
in haskellPackages.shellFor
{
packages = p: [self.packages.${system}.pixura-contracts];
withHoogle = true;
buildInputs = with haskellPackages;
[
haskell-language-server
cabal-install
];
# Change the prompt to show that you are in a devShell
# shellHook = "export PS1='\\e[1;34mdev > \\e[0m'";
});
};
}
2 changes: 1 addition & 1 deletion package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ default-extensions:
dependencies:
- base >=4.7 && <5
- generics-sop
- web3
- web3-ethereum
library:
source-dirs: hs-contracts/src
ghc-options: -Wall -Werror
4 changes: 2 additions & 2 deletions pixura-contracts.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.34.4.
-- This file has been generated from package.yaml by hpack version 0.34.7.
--
-- see: https://github.com/sol/hpack

Expand Down Expand Up @@ -91,5 +91,5 @@ library
build-depends:
base >=4.7 && <5
, generics-sop
, web3
, web3-ethereum
default-language: Haskell2010
14 changes: 13 additions & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ packages:
allow-newer: true

extra-deps:
- git: https://github.com/Pixura/hs-web3
- git: https://github.com/superrare/hs-web3
commit: 0713a7664dcb768af311de7a9940906fa5c29f8a
subdirs:
- packages/bignum
- packages/crypto
- packages/ethereum
- packages/hexstring
- packages/ipfs
- packages/jsonrpc
- packages/polkadot
- packages/provider
- packages/scale
- packages/solidity
- packages/web3
- relapse-1.0.0.0@sha256:b89ea23189e07f377be4e2a4deccf3d6ba7f547ed8ad77e27b35d78801efd81c

0 comments on commit 4866b6b

Please sign in to comment.