Skip to content

Commit

Permalink
update flake
Browse files Browse the repository at this point in the history
  • Loading branch information
andrevidela committed Dec 3, 2024
1 parent 7b989c6 commit 10ae69f
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 41 deletions.
75 changes: 46 additions & 29 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 11 additions & 12 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
description = "Opt-in Stack Flake";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.solc.url = "github:hellwolf/solc.nix";
inputs.solc = {
url = "github:hellwolf/solc.nix";
inputs.nixpkgs.follows = "nixpkgs";
};

outputs = { self, nixpkgs, flake-utils, solc }:
flake-utils.lib.eachDefaultSystem (system:
Expand All @@ -16,11 +19,13 @@

hPkgs = pkgs.haskell.packages."ghc963"; # need to match Stackage LTS version from stack.yaml resolver

minimalDevTools = [
devTools = [
hPkgs.ghc # GHC compiler in the desired version (will be available on PATH)
pkgs.zlib # External C library needed by some Haskell packages
pkgs.libff
pkgs.secp256k1
stack-wrapped
pkgs.solc_0_8_26
(solc.mkDefault pkgs pkgs.solc_0_8_26)
];

stack-wrapped = pkgs.symlinkJoin {
Expand All @@ -30,25 +35,19 @@
postBuild = ''
wrapProgram $out/bin/stack \
--add-flags "\
--no-nix \
--system-ghc \
--no-install-ghc \
"
'';
};
in {
devShells.default = pkgs.mkShell {
buildInputs = minimalDevTools;
buildInputs = devTools;

# Make external Nix c libraries like zlib known to GHC, like
# pkgs.haskell.lib.buildStackProject does
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath minimalDevTools;
};
devShells.minimal = pkgs.mkShell {
buildInputs = minimalDevTools;

# Make external Nix c libraries like zlib known to GHC, like
# pkgs.haskell.lib.buildStackProject does
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath minimalDevTools;
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath devTools;
};
});
}
Expand Down

0 comments on commit 10ae69f

Please sign in to comment.