Skip to content

Commit

Permalink
Eliminate only-tools devShell
Browse files Browse the repository at this point in the history
`cabal-local` no longer triggers rebuilds of GHC, so now we can use the
devShell that provides the same environment as our build.
  • Loading branch information
sellout committed Jun 27, 2024
1 parent d483188 commit 71ce523
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@

devShells =
renameAttrs (name: "cabal-${name}") haskell-nix-flake.devShells
// {default = self.devShells."${system}".cabal-only-tools;};
// {default = self.devShells."${system}".cabal-local;};

checks = renameAttrs (name: "component-${name}") haskell-nix-flake.checks;

Expand Down
16 changes: 6 additions & 10 deletions nix/haskell-nix-flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
shellFor = args: unison-project.shellFor (commonShellArgs args);

localPackages = lib.filterAttrs (k: v: v.isLocal or false) unison-project.hsPkgs;
localPackageNames = builtins.attrNames localPackages;
in
haskell-nix-flake
// {
Expand All @@ -76,21 +75,18 @@ in
defaultPackage = haskell-nix-flake.packages."unison-cli-main:exe:unison";

devShells = let
mkDevShell = pkgName:
mkDevShell = pkg:
shellFor {
packages = hpkgs: [hpkgs."${pkgName}"];
withHoogle = true;
packages = _hpkgs: [pkg];
## Enabling Hoogle causes us to rebuild GHC.
withHoogle = false;
};
in
{
only-tools = shellFor {
packages = _: [];
withHoogle = false;
};
local = shellFor {
packages = hpkgs: (map (p: hpkgs."${p}") localPackageNames);
packages = _hpkgs: builtins.attrValues localPackages;
withHoogle = false;
};
}
// lib.genAttrs localPackageNames mkDevShell;
// pkgs.lib.mapAttrs (_name: mkDevShell) localPackages;
}

0 comments on commit 71ce523

Please sign in to comment.