Skip to content

Commit

Permalink
flake.nix: refactoring
Browse files Browse the repository at this point in the history
- Remove default redundant default arguments in nix/default.nix
- Remove unused exports in flake
  • Loading branch information
gilligan committed Jun 8, 2021
1 parent 454be4e commit d1f577f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
5 changes: 4 additions & 1 deletion default.nix
Expand Up @@ -17,8 +17,11 @@
stackage = sources."stackage.nix";
};
}
# haskell-nix has to be used differently in flakes/no-flakes scenarios:
# - When imported from flakes, 'haskellNix.overlay' needs to be passed here.
# - When imported from default.nix without flakes, default to haskellNix.overlays
, haskellNixOverlays ? haskellNix.overlays
, packages ? import ./nix { inherit system sources crossSystem config sourcesOverride haskellNixOverlays checkMaterialization enableHaskellProfiling; }
, packages ? import ./nix { inherit system sources crossSystem config sourcesOverride haskellNix haskellNixOverlays checkMaterialization enableHaskellProfiling; }
# An explicit git rev to use, passed when we are in Hydra
# Whether to check that the pinned shas for haskell.nix are correct. We want this to be
# false, generally, since it does more work, but we set it to true in the CI
Expand Down
4 changes: 1 addition & 3 deletions flake.nix
Expand Up @@ -15,9 +15,7 @@
haskellNixOverlays = [ haskell-nix.overlay ];
};

inherit (topLevel) pkgs plutus ownOverlays;
inherit (plutus) haskell iohkNix;
inherit (plutus.lib) buildPursPackage buildNodeModules filterNpm gitignore-nix;
inherit (topLevel) pkgs plutus;
in
rec {
packages = rec {
Expand Down
16 changes: 4 additions & 12 deletions nix/default.nix
Expand Up @@ -3,17 +3,9 @@
, config ? { }
, overlays ? [ ]
, sourcesOverride ? { }
, sources ? import ./sources.nix { } // sourcesOverride
, haskellNix ? import sources."haskell.nix" {
sourcesOverride = {
hackage = sources."hackage.nix";
stackage = sources."stackage.nix";
};
}
# haskell-nix has to be used differently in flakes/no-flakes scenarios:
# - When imported from flakes, 'haskellNix.overlay' needs to be passed here.
# - When imported from default.nix without flakes, default to haskellNix.overlays
, haskellNixOverlays ? haskellNix.overlays
, sources
, haskellNix
, haskellNixOverlays
, checkMaterialization ? false
, enableHaskellProfiling ? false
}:
Expand All @@ -38,5 +30,5 @@ let

in
{
inherit pkgs plutus sources ownOverlays;
inherit pkgs plutus sources;
}

0 comments on commit d1f577f

Please sign in to comment.