Skip to content
Permalink
Browse files

Merge pull request #103 from jbgi/nix-tools

Allow build with nix-tools.
  • Loading branch information...
KtorZ committed Jun 12, 2019
2 parents 7548ec5 + 6b3957f commit 8179ddbdd75aea15c0db4106f527e622c9f9b963
Showing with 1,058 additions and 56 deletions.
  1. +10 −0 .buildkite/pipeline.yml
  2. +1 −0 .envrc
  3. +6 −0 .gitattributes
  4. +8 −0 cabal.project
  5. +44 −12 default.nix
  6. +2 −0 lib/bech32/bech32.cabal
  7. +0 −1 lib/cli/LICENSE
  8. +2 −1 lib/cli/cardano-wallet-cli.cabal
  9. +0 −1 lib/core/LICENSE
  10. +3 −2 lib/core/cardano-wallet-core.cabal
  11. +0 −1 lib/http-bridge/LICENSE
  12. +2 −1 lib/http-bridge/cardano-wallet-http-bridge.cabal
  13. +0 −1 lib/jormungandr/LICENSE
  14. +2 −1 lib/jormungandr/cardano-wallet-jormungandr.cabal
  15. +0 −1 lib/launcher/LICENSE
  16. +2 −1 lib/launcher/cardano-wallet-launcher.cabal
  17. +0 −1 lib/text-class/LICENSE
  18. +2 −1 lib/text-class/text-class.cabal
  19. +47 −0 nix/.stack.nix/bech32.nix
  20. +88 −0 nix/.stack.nix/cardano-crypto.nix
  21. +45 −0 nix/.stack.nix/cardano-wallet-cli.nix
  22. +123 −0 nix/.stack.nix/cardano-wallet-core.nix
  23. +135 −0 nix/.stack.nix/cardano-wallet-http-bridge.nix
  24. +70 −0 nix/.stack.nix/cardano-wallet-jormungandr.nix
  25. +44 −0 nix/.stack.nix/cardano-wallet-launcher.nix
  26. +55 −0 nix/.stack.nix/cardano-wallet.nix
  27. +25 −0 nix/.stack.nix/default.nix
  28. +42 −0 nix/.stack.nix/text-class.nix
  29. +12 −11 nix/cardano-http-bridge.nix
  30. +12 −0 nix/cardano-sl-node.nix
  31. +74 −0 nix/default.nix
  32. +2 −3 nix/iohk-common.nix
  33. +7 −0 nix/iohk-nix-src.json
  34. +0 −7 nix/iohk-nix.json
  35. +2 −2 nix/nixpkgs-src.json
  36. +5 −0 nix/regenerate.sh
  37. +111 −0 nix/release-lib.nix
  38. +6 −8 nix/stack-shell.nix
  39. +9 −0 nix/update-iohk-nix.sh
  40. +14 −0 nix/util.nix
  41. +43 −0 release.nix
  42. +1 −0 shell.nix
  43. +2 −0 stack.yaml
@@ -0,0 +1,10 @@
steps:
- label: Check Hydra evaluation of release.nix
command: 'nix-build -A iohkLib.check-hydra -o check-hydra.sh && ./check-hydra.sh'
agents:
system: x86_64-linux

- label: Check auto-generated Nix
command: 'nix-build -A iohkLib.check-nix-tools -o check-nix-tools.sh && ./check-nix-tools.sh'
agents:
system: x86_64-linux
1 .envrc
@@ -0,0 +1 @@
eval "$(lorri direnv)"
@@ -0,0 +1,6 @@
# GitHub Linguist annotations.
# Hide nix/.stack.nix/*.nix
# That is stuff that is generated by nix-tools stack-to-nix

nix/.stack.nix/*.nix linguist-generated=true
.stack-to-nix.cache linguist-generated=true
@@ -0,0 +1,8 @@
packages:
cardano-wallet.cabal
lib/*/*.cabal

benchmarks: True
tests: True

flags: +development
@@ -1,20 +1,52 @@
{ system ? builtins.currentSystem
, crossSystem ? null
, config ? {}

# Import IOHK common nix lib
, iohkLib ? import ./nix/iohk-common.nix
# Pin nixpkgs to a revision on the nixos-19.03 channel
, nixpkgs ? iohkLib.fetchNixpkgs ./nix/nixpkgs-src.json
, pkgs ? import nixpkgs { inherit system crossSystem config; }

# Keep this argument even if unused.
# It will prevent Hydra from caching the evaluation.
, gitrev ? iohkLib.commitIdFromGitRepo ./.
, iohkLib ? import ./nix/iohk-common.nix { inherit system crossSystem config; }
# Use nixpkgs pin from iohkLib
, pkgs ? iohkLib.pkgs
}:

{
inherit pkgs;
with import ./nix/util.nix { inherit pkgs; };

let
haskell = iohkLib.nix-tools.haskell { inherit pkgs; };
src = iohkLib.cleanSourceHaskell ./.;

inherit (iohkLib.rust-packages.pkgs) jormungandr;
cardano-http-bridge = iohkLib.rust-packages.pkgs.callPackage
./nix/cardano-http-bridge.nix { inherit pkgs; };
cardano-sl-node = import ./nix/cardano-sl-node.nix { inherit pkgs; };

haskellPackages = import ./nix/default.nix {
inherit pkgs haskell src;
inherit cardano-http-bridge cardano-sl-node jormungandr;
inherit (iohkLib.nix-tools) iohk-extras iohk-module;
};

in {
inherit pkgs iohkLib src haskellPackages;
inherit cardano-http-bridge cardano-sl-node jormungandr;
inherit (haskellPackages.cardano-wallet.identifier) version;

cardano-wallet = haskellPackages.cardano-wallet.components.exes.cardano-wallet;
cardano-wallet-launcher = haskellPackages.cardano-wallet.components.exes.cardano-wallet-launcher;
tests = collectComponents "tests" isCardanoWallet haskellPackages;
benchmarks = collectComponents "benchmarks" isCardanoWallet haskellPackages;

cardano-http-bridge = import ./nix/cardano-http-bridge.nix { inherit pkgs; };
shell = haskellPackages.shellFor {
name = "cardano-wallet-shell";
packages = ps: with ps; [
cardano-wallet
cardano-wallet-cli
cardano-wallet-core
cardano-wallet-http-bridge
cardano-wallet-launcher
bech32
text-class
];
buildInputs =
with pkgs.haskellPackages; [ cabal-install hlint stylish-haskell weeder ghcid ]
++ [ cardano-http-bridge jormungandr cardano-sl-node pkgs.pkgconfig pkgs.sqlite-interactive ];
};
}
@@ -65,6 +65,8 @@ test-suite bech32-test
, QuickCheck
, text
, vector
build-tools:
hspec-discover
main-is:
Main.hs
other-modules:

This file was deleted.

@@ -6,7 +6,6 @@ author: IOHK Engineering Team
maintainer: operations@iohk.io
copyright: 2019 IOHK
license: MIT
license-file: LICENSE
category: Web
build-type: Simple
cabal-version: >=1.10
@@ -62,6 +61,8 @@ test-suite unit
, QuickCheck
, text
, text-class
build-tools:
hspec-discover
type:
exitcode-stdio-1.0
hs-source-dirs:

This file was deleted.

@@ -7,7 +7,6 @@ author: IOHK Engineering Team
maintainer: operations@iohk.io
copyright: 2019 IOHK
license: MIT
license-file: LICENSE
category: Web
build-type: Simple
extra-source-files: README.md
@@ -146,8 +145,10 @@ test-suite unit
, transformers
, tree-diff
, yaml
build-tools:
hspec-discover
type:
exitcode-stdio-1.0
exitcode-stdio-1.0
hs-source-dirs:
test/unit
main-is:

This file was deleted.

@@ -7,7 +7,6 @@ author: IOHK Engineering Team
maintainer: operations@iohk.io
copyright: 2019 IOHK
license: MIT
license-file: LICENSE
category: Web
build-type: Simple
extra-source-files: README.md
@@ -97,6 +96,8 @@ test-suite unit
, text
, text-class
, transformers
build-tools:
hspec-discover
type:
exitcode-stdio-1.0
hs-source-dirs:

This file was deleted.

@@ -7,7 +7,6 @@ author: IOHK Engineering Team
maintainer: operations@iohk.io
copyright: 2019 IOHK
license: MIT
license-file: LICENSE
category: Web
build-type: Simple
extra-source-files: README.md
@@ -83,6 +82,8 @@ test-suite unit
, QuickCheck
, text
, text-class
build-tools:
hspec-discover
type:
exitcode-stdio-1.0
hs-source-dirs:

This file was deleted.

@@ -6,7 +6,6 @@ author: IOHK Engineering Team
maintainer: operations@iohk.io
copyright: 2019 IOHK
license: MIT
license-file: LICENSE
category: Web
build-type: Simple
cabal-version: >=1.10
@@ -65,6 +64,8 @@ test-suite unit
, fmt
, hspec
, text
build-tools:
hspec-discover
type:
exitcode-stdio-1.0
hs-source-dirs:

This file was deleted.

@@ -6,7 +6,6 @@ author: IOHK Engineering Team
maintainer: operations@iohk.io
copyright: 2019 IOHK
license: MIT
license-file: LICENSE
category: Web
build-type: Simple
cabal-version: >=1.10
@@ -60,6 +59,8 @@ test-suite unit
, QuickCheck
, text
, text-class
build-tools:
hspec-discover
type:
exitcode-stdio-1.0
hs-source-dirs:

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

0 comments on commit 8179ddb

Please sign in to comment.
You can’t perform that action at this time.