Skip to content

Commit 4866b6b

Browse files
Update to new version of hs-web3 and GHC 9.2.4
1 parent b87edf4 commit 4866b6b

6 files changed

+83
-28
lines changed

default.nix

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
{ mkDerivation, base, generics-sop, hpack, lib, zlib }:
1+
{ mkDerivation, base, generics-sop, hpack, lib, zlib, web3 }:
22
mkDerivation {
33
pname = "pixura-contracts";
44
version = "0.3.0.0";
55
src = ./.;
6-
libraryHaskellDepends = [ base generics-sop ];
6+
libraryHaskellDepends = [ base generics-sop web3 ];
77
libraryPkgconfigDepends = [ zlib ];
88
libraryToolDepends = [ hpack ];
99
prePatch = "hpack";

flake.lock

+37-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+28-18
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,48 @@
11
{
22
# inspired by: https://serokell.io/blog/practical-nix-flakes#packaging-existing-applications
33
description = "A Hello World in Haskell with a dependency and a devShell";
4-
inputs.nixpkgs.url = "nixpkgs";
5-
outputs = { self, nixpkgs }:
4+
inputs =
5+
{
6+
nixpkgs.url = "nixpkgs";
7+
hs-web3 =
8+
{ url = "hs-web3";
9+
inputs.nixpkgs.url = "nixpkgs";
10+
};
11+
};
12+
outputs = { self, nixpkgs, hs-web3 }:
613
let
714
supportedSystems = [ "x86_64-linux" "x86_64-darwin" ];
815
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
916
nixpkgsFor = forAllSystems (system: import nixpkgs {
1017
inherit system;
11-
overlays = [ self.overlay ];
18+
overlays = [ (self.overlay system) ];
1219
});
1320
in
1421
{
15-
overlay = (final: prev: {
16-
pixura-contracts = final.haskell.packages.ghc923.callPackage (import ./default.nix) {
22+
overlay = (system: final: prev: {
23+
pixura-contracts = final.haskell.packages.ghc924.callPackage (import ./default.nix) {
1724
inherit (final) zlib;
25+
inherit (hs-web3.packages.${system}) web3;
1826
};
1927
});
2028
packages = forAllSystems (system: {
2129
pixura-contracts = nixpkgsFor.${system}.pixura-contracts;
2230
});
2331
defaultPackage = forAllSystems (system: self.packages.${system}.pixura-contracts);
2432
checks = self.packages;
25-
devShell = forAllSystems (system: let haskellPackages = nixpkgsFor.${system}.haskell.packages.ghc923;
26-
in haskellPackages.shellFor {
27-
packages = p: [self.packages.${system}.pixura-contracts];
28-
withHoogle = true;
29-
buildInputs = with haskellPackages; [
30-
haskell-language-server
31-
ghcid
32-
cabal-install
33-
];
34-
# Change the prompt to show that you are in a devShell
35-
# shellHook = "export PS1='\\e[1;34mdev > \\e[0m'";
36-
});
37-
};
33+
devShell = forAllSystems (system:
34+
let haskellPackages = nixpkgsFor.${system}.haskell.packages.ghc924;
35+
in haskellPackages.shellFor
36+
{
37+
packages = p: [self.packages.${system}.pixura-contracts];
38+
withHoogle = true;
39+
buildInputs = with haskellPackages;
40+
[
41+
haskell-language-server
42+
cabal-install
43+
];
44+
# Change the prompt to show that you are in a devShell
45+
# shellHook = "export PS1='\\e[1;34mdev > \\e[0m'";
46+
});
47+
};
3848
}

package.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ default-extensions:
4848
dependencies:
4949
- base >=4.7 && <5
5050
- generics-sop
51-
- web3
51+
- web3-ethereum
5252
library:
5353
source-dirs: hs-contracts/src
5454
ghc-options: -Wall -Werror

pixura-contracts.cabal

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 1.12
22

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

@@ -91,5 +91,5 @@ library
9191
build-depends:
9292
base >=4.7 && <5
9393
, generics-sop
94-
, web3
94+
, web3-ethereum
9595
default-language: Haskell2010

stack.yaml

+13-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ packages:
77
allow-newer: true
88

99
extra-deps:
10-
- git: https://github.com/Pixura/hs-web3
10+
- git: https://github.com/superrare/hs-web3
1111
commit: 0713a7664dcb768af311de7a9940906fa5c29f8a
12+
subdirs:
13+
- packages/bignum
14+
- packages/crypto
15+
- packages/ethereum
16+
- packages/hexstring
17+
- packages/ipfs
18+
- packages/jsonrpc
19+
- packages/polkadot
20+
- packages/provider
21+
- packages/scale
22+
- packages/solidity
23+
- packages/web3
1224
- relapse-1.0.0.0@sha256:b89ea23189e07f377be4e2a4deccf3d6ba7f547ed8ad77e27b35d78801efd81c

0 commit comments

Comments
 (0)