Skip to content

Commit 2758551

Browse files
committed
Support for overriding package src
1 parent 9014e6e commit 2758551

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

overlays/haskell.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,7 @@ final: prev: {
712712
flags = p.flags;
713713
components = getComponents cabal2nix.components hsPkgs p;
714714
package = cabal2nix.package // {
715+
identifier = { name = p.pkg-name; version = p.pkg-version; };
715716
isProject = false;
716717
setup-depends = map (lookupDependency hsPkgs.pkgsBuildBuild) (p.components.setup.depends or []);
717718
# TODO = map (lookupExeDependency hsPkgs.pkgsBuildBuild) (p.components.setup.exe-depends or []);
@@ -738,6 +739,7 @@ final: prev: {
738739
flags = p.flags;
739740
components = getComponents cabal2nix.components hsPkgs p;
740741
package = cabal2nix.package // {
742+
identifier = { name = p.pkg-name; version = p.pkg-version; };
741743
isProject = true;
742744
setup-depends = map (lookupDependency hsPkgs.pkgsBuildBuild) (p.components.setup.depends or []);
743745
# TODO = map (lookupExeDependency hsPkgs.pkgsBuildBuild) (p.components.setup.exe-depends or []);
@@ -767,9 +769,9 @@ final: prev: {
767769
library = mapOptions components.library;
768770
} // final.lib.optionalAttrs (components.setup or null != null) {
769771
setup = mapOptions components.setup;
770-
} // builtins.mapAttrs (ctype: cs: builtins.mapAttrs (cname: c: __trace "${ctype} ${cname}" mapOptions c) cs) (builtins.removeAttrs components ["library" "setup"]));
772+
} // builtins.mapAttrs (ctype: cs: builtins.mapAttrs (cname: c: mapOptions c) cs) (builtins.removeAttrs components ["library" "setup"]));
771773
} // builtins.mapAttrs (n: _:
772-
final.lib.mkIf (config.packages ? ${p.pkg-name}) (final.lib.mkOverride (if n == "src" then 90 else 995) config.packages.${p.pkg-name}.${n}))
774+
final.lib.mkIf (config.packages ? ${p.pkg-name}) (final.lib.mkOverride (if n == "src" then (if config.packages.${p.pkg-name}.src != null then 90 else 10000) else 995) config.packages.${p.pkg-name}.${n}))
773775
((import ../modules/package-options.nix { inherit haskellLib; inherit (final) lib; }).options // { src = {}; });
774776
}) (final.lib.filter (p: to-key p != p.pkg-name) plan-json.install-plan));
775777
})

0 commit comments

Comments
 (0)