Skip to content

Commit

Permalink
move nix-tools logic to nix/haskell-packages
Browse files Browse the repository at this point in the history
Avoids infinite recursion with release.nix including byronProxyScripts
  • Loading branch information
disassembler committed May 16, 2019
1 parent 0107f07 commit 12a7783
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 14 deletions.
18 changes: 5 additions & 13 deletions default.nix
@@ -1,6 +1,5 @@
{ ... }@args:
#
# The defaul.nix file. This will generate targets for all
# The default.nix file. This will generate targets for all
# buildables (see release.nix for nomenclature, excluding
# the "build machine" last part, specific to release.nix), eg.:
#
Expand All @@ -27,29 +26,22 @@
# https://github.com/input-output-hk/iohk-nix/blob/master/docs/nix-toolification.org#for-a-stackage-project
#

# We will need to import the iohk-nix common lib, which includes
# the nix-tools tooling.
let
commonLib = import ./nix/iohk-common.nix;

# This file needs to export a function that takes
# the arguments it is passed and forwards them to
# the default-nix template from iohk-nix. This is
# important so that the release.nix file can properly
# parameterize this file when targetting different
# hosts.
nixTools = commonLib.nix-tools.default-nix ./nix/pkgs.nix args;
# Haskell Packages produced by nix-tools
haskellPackages = import ./nix/haskell-packages.nix {};
# TODO: remove when proxy and old cardano configs no
# longer required.
oldCardanoSrc = import ./nix/old-cardano.nix {
inherit commonLib;
};
byronProxy = nixTools.nix-tools.exes.byron-proxy;
byronProxy = haskellPackages.nix-tools.exes.byron-proxy;
# TODO: move scripts to cardano-shell at some point.
byronProxyScripts = import ./nix/byron-proxy-scripts.nix {
inherit commonLib oldCardanoSrc byronProxy;
};
in {
inherit byronProxyScripts commonLib;
inherit (nixTools) nix-tools;
inherit (haskellPackages) nix-tools;
}
48 changes: 48 additions & 0 deletions nix/haskell-packages.nix
@@ -0,0 +1,48 @@
#
# The defaul.nix file. This will generate targets for all
# buildables (see release.nix for nomenclature, excluding
# the "build machine" last part, specific to release.nix), eg.:
#
# - nix build -f default.nix nix-tools.tests.io-sim # All `io-sim` tests
# - nix build -f default.nix nix-tools.tests.ouroboros-consensus.test-consensus
#
# Generated targets include anything from stack.yaml (via
# nix-tools:stack-to-nix and the nix/regenerate.sh script)
# or cabal.project (via nix-tools:plan-to-nix), including all
# version overrides specified there.
#
# Nix-tools stack-to-nix will generate the `nix/.stack-pkgs.nix`
# file which is imported from the `nix/pkgs.nix` where further
# customizations outside of the ones in stack.yaml/cabal.project
# can be specified as needed for nix/ci.
#
# Please run `nix/regenerate.sh` after modifying stack.yaml
# or relevant part of cabal configuration files.
# When switching to recent stackage or hackage package version,
# you might also need to update the iohk-nix common lib. You
# can do so by running the `nix/update-iohk-nix.sh` script.
#
# More information about iohk-nix and nix-tools is available at:
# https://github.com/input-output-hk/iohk-nix/blob/master/docs/nix-toolification.org#for-a-stackage-project
#


# We will need to import the iohk-nix common lib, which includes
# the nix-tools tooling.
let
commonLib = import ./nix/iohk-common.nix;
in
# This file needs to export a function that takes
# the arguments it is passed and forwards them to
# the default-nix template from iohk-nix. This is
# important so that the release.nix file can properly
# parameterize this file when targetting different
# hosts.
{ ... }@args:
# We will instantiate the default-nix template with the
# nix/pkgs.nix file...
commonLib.nix-tools.default-nix ./nix/pkgs.nix args
# ... and add additional non-haskell packages we want to build on CI:
// {

}
2 changes: 1 addition & 1 deletion release.nix
Expand Up @@ -11,7 +11,7 @@ commonLib.pkgs.lib.mapAttrsRecursiveCond
(as: !(as ? "type" && as.type == "derivation"))
(path: v: if (builtins.elem path disabled) then null else v)
(commonLib.nix-tools.release-nix {
package-set-path = ./.;
package-set-path = ./nix/haskell-packages.nix;

# packages from our stack.yaml or plan file (via nix/pkgs.nix) we
# are interested in building on CI via nix-tools.
Expand Down

0 comments on commit 12a7783

Please sign in to comment.