From 6f808dfe189bef874702e04f3d44b038a8fcb382 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Mon, 29 Jun 2020 09:38:17 -0400 Subject: refactor(xan): Simplify build infrastructure Simplify the build infrastructure for creating shells etc. for xanthous, including relying more heavily on stuff exposed in Depot anyway, using shellFor in the shell.nix, and using the haskell.nix branch of all-hies for a significantly simpler build. At some point the all-hies stuff will likely want to be promoted up to //third_party, but for now it's experimental enough that I don't want to bother other people with it. Change-Id: I43830de73830fdc07d48af9b87d7930f59599532 Reviewed-on: https://cl.tvl.fyi/c/depot/+/890 Tested-by: BuildkiteCI Reviewed-by: glittershark Reviewed-by: BuildkiteCI --- users/glittershark/xanthous/shell.nix | 48 +++++++++++------------------------ 1 file changed, 15 insertions(+), 33 deletions(-) (limited to 'users/glittershark/xanthous/shell.nix') diff --git a/users/glittershark/xanthous/shell.nix b/users/glittershark/xanthous/shell.nix index b78844c0ee..491f0779f8 100644 --- a/users/glittershark/xanthous/shell.nix +++ b/users/glittershark/xanthous/shell.nix @@ -1,35 +1,17 @@ -{ nixpkgs ? import ./nixpkgs.nix {} -, pkgs ? nixpkgs.pkgs -, compiler ? "ghc865" -, withHoogle ? true -}: -let - pkg = import ./pkg.nix { inherit pkgs; }; +{ pkgs ? (import ../../../. {}).third_party, ... }: - packageSet = ( - if compiler == "default" - then pkgs.haskellPackages - else pkgs.haskell.packages.${compiler} - ); +(pkgs.haskellPackages.extend (pkgs.haskell.lib.packageSourceOverrides { + xanthous = pkgs.gitignoreSource ./.; +})).shellFor { + packages = p: [p.xanthous]; + withHoogle = true; + buildInputs = with pkgs.haskellPackages; [ + cabal-install + ghc-prof-flamegraph + hp2pretty + ]; - haskellPackages = ( - if withHoogle - then packageSet.override { - overrides = (self: super: { - ghc = super.ghc // { withPackages = super.ghc.withHoogle; }; - ghcWithPackages = self.ghc.withPackages; - } // (import ../../../third_party/haskell_overlay { inherit pkgs; }) - self super); - } - else packageSet - ); - - drv = pkgs.haskell.lib.doBenchmark (haskellPackages.callPackage pkg {}); - - inherit (pkgs.haskell.lib) addBuildTools; -in -(addBuildTools drv (with haskellPackages; [ - cabal-install - ghc-prof-flamegraph - hp2pretty -])).env + nativeBuildInputs = [ + (import ./hie.nix { inherit pkgs; }) + ]; +} -- cgit 1.4.1