-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
got nix flake working; still need to take out fake package
- Loading branch information
Showing
4 changed files
with
102 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,46 @@ | ||
packages: txg.cabal | ||
|
||
package aeson | ||
flags: +cffi | ||
|
||
source-repository-package | ||
type: git | ||
location: https://github.com/kadena-io/pact.git | ||
tag: 0c51656d9cdad608c88d0c42e57c5f781dabe25b | ||
tag: 75a3c9fbd79a5c748fe1ac4cd61f800d3164a628 | ||
--sha256: sha256-+XYLIHz7VV1jS0KTEI5gzgZYCI6pjstlP4AXGna2t5k= | ||
|
||
source-repository-package | ||
type: git | ||
location: https://github.com/kadena-io/thyme.git | ||
tag: 6ee9fcb026ebdb49b810802a981d166680d867c9 | ||
--sha256: sha256-DqGIoPGBg8py044Xa7l/Y09K+cKGFwlxONHoZRJyzCU= | ||
|
||
source-repository-package | ||
type: git | ||
tag: e43073d0b8d89d9b300980913b842f4be339846d | ||
location: https://github.com/kadena-io/pact-json | ||
--sha256: sha256-ZWbAId0JBaxDsYhwcYUyw04sjYstXyosSCenzOvUxsQ= | ||
|
||
-- Patch merged into master (upcoming verison 10.0). We are currently using 9.2 | ||
source-repository-package | ||
type: git | ||
tag: 3946a0e94470d7403a855dd60f8e54687ecc2b1d | ||
location: https://github.com/larskuhtz/sbv | ||
--sha256: 1msbz6525nmsywpm910jh23siil4qgn3rpsm52m8j6877r7v5zw3 | ||
|
||
package hostaddress | ||
flags: +with-configuration-tools +with-aeson | ||
|
||
|
||
package configuration-tools | ||
flags: -remote-configs | ||
|
||
constraints: sbv <=8.8 | ||
constraints: base64-bytestring <= 1.1.0.0 | ||
-- constraints: sbv <=8.8 | ||
constraints: sbv < 10 | ||
|
||
-- these upper bounds are required in order to not break payload validation in chainweb | ||
constraints: base16-bytestring <1 | ||
constraints: base64-bytestring <1.1 | ||
|
||
allow-newer: base64-bytestring:* | ||
allow-newer: base16-bytestring:* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,96 +1,44 @@ | ||
{ | ||
description = "Chainweb transaction generator"; | ||
|
||
inputs = { | ||
nixpkgs.follows = "haskellNix/nixpkgs-unstable"; | ||
haskellNix.url = "github:input-output-hk/haskell.nix"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
|
||
nixConfig = { | ||
# This sets the flake to use the IOG nix cache. | ||
# Nix should ask for permission before using it. | ||
# but remove it here if you do not want it. | ||
extra-substituters = [ "https://cache.iog.io" "https://nixcache.chainweb.com" ]; | ||
extra-trusted-public-keys = ["hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" "nixcache.chainweb.com:FVN503ABX9F8x8K0ptnc99XEz5SaA4Sks6kNcZn2pBY="]; | ||
allow-import-from-derivation = "true"; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils, haskellNix}: | ||
flake-utils.lib.eachSystem | ||
[ "x86_64-linux" "x86_64-darwin" | ||
"aarch64-linux" "aarch64-darwin"] (system: | ||
let | ||
pkgs = import nixpkgs { inherit system;}; | ||
hsPkgs = pkgs.haskell.packages.ghc884; | ||
nix-thunk = import ./deps/nix-thunk {}; | ||
gitignoreSrc = import (pkgs.fetchFromGitHub { | ||
owner = "hercules-ci"; | ||
repo = "gitignore"; | ||
rev = "9e80c4d83026fa6548bc53b1a6fab8549a6991f6"; | ||
sha256 = "04n9chlpbifgc5pa3zx6ff3rji9am6msrbn1z3x1iinjz2xjfp4p"; | ||
}) {}; | ||
in { defaultPackage = hsPkgs.developPackage { | ||
root = gitignoreSrc.gitignoreSource ./.; | ||
name = builtins.baseNameOf ./.; | ||
withHoogle = false; | ||
source-overrides = { | ||
chainweb-api = nix-thunk.thunkSource ./deps/chainweb-api; | ||
pact = nix-thunk.thunkSource ./deps/pact; | ||
}; | ||
overrides = self: super: with pkgs.haskell.lib; rec { | ||
aeson = dontCheck (self.callHackageDirect { | ||
pkg = "aeson"; | ||
ver = "1.5.6.0"; | ||
sha256 = "18yb8j0jvvzp275ylj16hskgxwdy55hljch9bjvpxl25vvslnk1n"; | ||
} {}); | ||
base64 = self.callHackageDirect { | ||
pkg = "base64"; | ||
ver = "0.4.2.3"; | ||
sha256 = "1i4cf1xfbkxlxshwlsxgw2w5gi3hkkfm1n99vnzq7rixz8nxcw7r"; | ||
} {}; | ||
configuration-tools = dontBenchmark (dontCheck (self.callHackageDirect { | ||
pkg = "configuration-tools"; | ||
ver = "0.6.0"; | ||
sha256 = "0ia2bhy35qv1xgbqrx0jalxznj8zgg97y0zkp8cnr1r3pq5adbcd"; | ||
} {})); | ||
## ghc-byteorder = self.callHackageDirect { | ||
## pkg = "ghc-byteorder"; | ||
## ver = "4.11.0.0.10"; | ||
## sha256 = "1inrpb74i811k0gh8iazfqayrqrl86pwsm3zqgxn0aivxjh2ygsz"; | ||
## } {}; | ||
hostaddress = overrideCabal (enableCabalFlag (enableCabalFlag (doJailbreak (self.callHackageDirect { | ||
pkg = "hostaddress"; | ||
ver = "0.1.0.0"; | ||
sha256 = "13wqzkw32inc8v03vl94ibzxdy0hmiybch62c8rana38r4yn4fnl"; | ||
} {})) "with-configuration-tools") "with-aeson") (drv: { | ||
librarySystemDepends = drv.librarySystemDepends or [] ++ [self.aeson self.configuration-tools optparse-applicative]; | ||
}); | ||
optparse-applicative = dontCheck (self.callHackageDirect { | ||
pkg = "optparse-applicative"; | ||
ver = "0.15.1.0"; | ||
sha256 = "1mii408cscjvids2xqdcy2p18dvanb0qc0q1bi7234r23wz60ajk"; | ||
} {}); | ||
pact = overrideCabal (enableCabalFlag (dontCheck (doJailbreak super.pact)) "build-tool") (drv: | ||
{ patches = drv.patches or [] ++ [./pact-base16-bytestring.patch]; }); | ||
pretty-simple = dontCheck (self.callHackageDirect { | ||
pkg = "pretty-simple"; | ||
ver = "3.3.0.0"; | ||
sha256 = "19zwzzvjgadmzp9gw235bsr6wkljr8k0cqy75h5q8n0d5m60ip7m"; | ||
} {}); | ||
prettyprinter = dontCheck (self.callHackageDirect { | ||
pkg = "prettyprinter"; | ||
ver = "1.6.0"; | ||
sha256 = "0f8wqaj3cv3yra938afqf62wrvq20yv9jd048miw5zrfavw824aa"; | ||
} {}); | ||
}; | ||
modifier = drv: pkgs.lib.overrideDerivation drv (attrs: { | ||
buildTools = (attrs.buildTools or []) ++ [ | ||
hsPkgs.cabal-install | ||
hsPkgs.ghcid | ||
]; | ||
}); | ||
}; | ||
}); | ||
|
||
description = "TXG: Chainweb transaction generator"; | ||
inputs.haskellNix.url = "github:input-output-hk/haskell.nix"; | ||
inputs.nixpkgs.follows = "haskellNix/nixpkgs-unstable"; | ||
inputs.flake-utils.url = "github:numtide/flake-utils"; | ||
outputs = { self, nixpkgs, flake-utils, haskellNix }: | ||
flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" ] (system: | ||
let | ||
overlays = [ haskellNix.overlay | ||
(final: prev: { | ||
# This overlay adds our project to pkgs | ||
txgProject = | ||
final.haskell-nix.project' { | ||
src = ./.; | ||
compiler-nix-name = "ghc962"; | ||
projectFileName = "cabal.project"; | ||
# This is used by `nix develop .` to open a shell for use with | ||
# `cabal`, `hlint` and `haskell-language-server` | ||
shell.tools = { | ||
cabal = {}; | ||
hlint = {}; | ||
haskell-language-server = {}; | ||
}; | ||
# Non-Haskell shell tools go here | ||
shell.buildInputs = with pkgs; [ | ||
nixpkgs-fmt | ||
]; | ||
# This adds `js-unknown-ghcjs-cabal` to the shell. | ||
# shell.crossPlatforms = p: [p.ghcjs]; | ||
}; | ||
}) | ||
]; | ||
pkgs = import nixpkgs { inherit system overlays; inherit (haskellNix) config; }; | ||
flake = pkgs.txgProject | ||
.flake { | ||
# This adds support for `nix build .#js-unknown-ghcjs:hello:exe:hello` | ||
# crossPlatforms = p: [p.ghcjs]; | ||
}; | ||
in flake // { | ||
# Built by `nix build .` | ||
packages.default = flake.packages."txg:exe:txg"; | ||
}); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters