From 460a470aceda32eec69207fa4ab9fc67c5fc0397 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 2 Dec 2026 15:15:51 +0000 Subject: pkgs/haskell: leave dist-newstyle/ out of the copied source lib.cleanSource kept cabal's build directory, so a checkout with a build in it was copied into the store whole. mylib.copyWithout, as for Rust, leaves out .git, .graveyard and dist-newstyle. --- pkgs/haskell/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'pkgs/haskell/default.nix') diff --git a/pkgs/haskell/default.nix b/pkgs/haskell/default.nix index 5ab04d44..68b79b8c 100644 --- a/pkgs/haskell/default.nix +++ b/pkgs/haskell/default.nix @@ -14,6 +14,13 @@ self: super: let (lib.filterAttrs (pname: type: type == "directory" && builtins.pathExists (root + "/${pname}/${pname}.cabal")) (builtins.readDir root))); + + # Copies a Haskell project into the store, leaving out what the build + # doesn't need. + cleanHaskellSource = name: src: mylib.copyWithout { + inherit name src; + removeNames = [ ".git" ".graveyard" "dist-newstyle" ]; + }; in { # nixpkgs applies packageOverrides to every Haskell package set, including # haskellPackages. @@ -22,6 +29,6 @@ in { (hself: hsuper: mylib.mapNixDir (path: hself.callPackage path {}) [ ./. ] // - lib.mapAttrs (pname: src: hself.callCabal2nix pname (lib.cleanSource src) {}) automaticPackages); + lib.mapAttrs (pname: src: hself.callCabal2nix pname (cleanHaskellSource pname src) {}) automaticPackages); }; } -- cgit v1.3.1