Skip to content
Permalink
Browse files

move nix-tools logic to nix/haskell-packages

Avoids infinite recursion with release.nix including byronProxyScripts
  • Loading branch information...
disassembler committed May 16, 2019
1 parent 0107f07 commit 12a7783ec59cc120aa795e16f6119a56abf90af0
Showing with 54 additions and 14 deletions.
  1. +5 −13 default.nix
  2. +48 −0 nix/haskell-packages.nix
  3. +1 −1 release.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.:
#
@@ -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;
}
@@ -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:
// {

}
@@ -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.

0 comments on commit 12a7783

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