Skip to content

Commit

Permalink
addressing review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
disassembler committed Jun 28, 2018
1 parent a9a4ae4 commit 598b4c2
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 55 deletions.
9 changes: 2 additions & 7 deletions default.nix
Expand Up @@ -18,11 +18,7 @@ with pkgs.lib;
with pkgs.haskell.lib;

let
plutusPkgs = ((import ./pkgs { inherit pkgs; }).override {
ghc = overrideDerivation pkgs.haskell.compiler.ghc822 (drv: {
patches = drv.patches ++ [ ./ghc-8.0.2-darwin-rec-link.patch ];
});
});
plutusPkgs = import ./pkgs { inherit pkgs; };
cleanSourceFilter = with pkgs.stdenv;
name: type: let baseName = baseNameOf (toString name); in ! (
# Filter out .git repo
Expand All @@ -47,8 +43,7 @@ let
tests = {
shellcheck = pkgs.callPackage ./tests/shellcheck.nix { src = ./.; };
hedgehog = pkgs.callPackage ./tests/hedgehog.nix {
inherit pkgs plutusPkgs;
source = ./.;
inherit pkgs plutusPkgs source;
};
};
stack2nix = import (pkgs.fetchFromGitHub {
Expand Down
15 changes: 10 additions & 5 deletions fetch-nixpkgs.nix
@@ -1,8 +1,13 @@
let
# temporary hack until scripts/nix-shell.sh ceases to use -p
pkgs_path = import ./fetchNixpkgs.nix (builtins.fromJSON (builtins.readFile ./nixpkgs-src.json));
fetchNixpkgs = rev: sha256unpacked: builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
sha256 = sha256unpacked;
};
nixpkgsJson = builtins.fromJSON (builtins.readFile ./nixpkgs-src.json);
pkgs_path = fetchNixpkgs nixpkgsJson.rev nixpkgsJson.sha256unpacked;
pkgs = import pkgs_path { config = {}; overlays = []; };
wrapped = pkgs.runCommand "nixpkgs" {} ''
ln -sv ${pkgs_path} $out
'';
in if 0 <= builtins.compareVersions builtins.nixVersion "1.12" then wrapped else pkgs_path
in
pkgs.runCommand "nixpkgs" {} ''
ln -sv ${pkgs_path} $out
''
41 changes: 0 additions & 41 deletions fetchNixpkgs.nix

This file was deleted.

4 changes: 2 additions & 2 deletions lib.nix
@@ -1,6 +1,6 @@
let
# Allow overriding pinned nixpkgs for debugging purposes via cardano_pkgs
fetchNixPkgs = let try = builtins.tryEval <cardano_pkgs>;
# Allow overriding pinned nixpkgs for debugging purposes via plutus_pkgs
fetchNixPkgs = let try = builtins.tryEval <plutus_pkgs>;
in if try.success
then builtins.trace "using host <plutus_pkgs>" try.value
else import ./fetch-nixpkgs.nix;
Expand Down

0 comments on commit 598b4c2

Please sign in to comment.