Skip to content

Commit

Permalink
Merge pull request #57 from srid/make-package-src-independent
Browse files Browse the repository at this point in the history
Make package sources independent
  • Loading branch information
roberth authored Jan 18, 2023
2 parents 6a56fbd + f36d122 commit c6ff897
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion flake-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,18 @@ in
localPackagesOverlay = self: _:
let
fromSdist = self.buildFromCabalSdist or (builtins.trace "Your version of Nixpkgs does not support hs.buildFromCabalSdist yet." (pkg: pkg));
filterSrc = name: src: lib.cleanSourceWith { inherit src name; filter = path: type: true; };
in
lib.mapAttrs
(name: value: fromSdist (self.callCabal2nix name value.root { }))
(name: value:
let
# callCabal2nix does not need a filtered source. It will
# only pick out the cabal and/or hpack file.
pkgProto = self.callCabal2nix name value.root { };
pkgFiltered = pkgs.haskell.lib.overrideSrc pkgProto {
src = filterSrc name value.root;
};
in fromSdist pkgFiltered)
cfg.packages;
finalOverlay =
pkgs.lib.composeManyExtensions
Expand Down

0 comments on commit c6ff897

Please sign in to comment.