Skip to content

Commit 8fa0abb

Browse files
committed
Fix setting of planned flag
1 parent 0c1fdfc commit 8fa0abb

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

modules/install-plan/planned.nix

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Mark everthing in the install-plan as "planned"
2+
{getComponents}:
3+
{config, lib, ...}: {
4+
packages = lib.listToAttrs (map (p:
5+
let components =
6+
if p ? component-name
7+
then { ${p.component-name} = { inherit (p) depends exe-depends; }; }
8+
else p.components or {};
9+
in {
10+
name = p.id;
11+
value.components = lib.mapAttrs (type: x:
12+
if type == "library" || type == "setup"
13+
then { planned = lib.mkOverride 900 true; }
14+
else
15+
lib.mapAttrs (_: _: {
16+
planned = lib.mkOverride 900 true;
17+
}) x
18+
) (getComponents null {} p);
19+
}) config.plan-json.install-plan);
20+
}

overlays/haskell.nix

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,6 @@ final: prev: {
678678
name = final.lib.removePrefix "${prefix}:" n;
679679
value = (if cabal2nixComponents == null then {} else cabal2nixComponents.${collectionName}.${name}) // {
680680
buildable = true;
681-
planned = final.lib.mkOverride 900 true;
682681
} // lookupDependencies hsPkgs c.depends c.exe-depends;
683682
in { inherit name value; }
684683
)) components));
@@ -687,12 +686,10 @@ final: prev: {
687686
// final.lib.optionalAttrs (components ? lib) {
688687
library = (if cabal2nixComponents == null then {} else cabal2nixComponents.library) // {
689688
buildable = true;
690-
planned = final.lib.mkOverride 900 true;
691689
} // lookupDependencies hsPkgs components.lib.depends components.lib.exe-depends;
692690
} // final.lib.optionalAttrs (components ? setup) {
693691
setup = {
694692
buildable = true;
695-
planned = final.lib.mkOverride 900 true;
696693
} // lookupDependencies hsPkgs.pkgsBuildBuild (components.setup.depends or []) (components.setup.exe-depends or []);
697694
};
698695
callProjectResults = callCabalProjectToNix config;
@@ -782,6 +779,7 @@ final: prev: {
782779
{ inherit plan-json; }
783780
(import ../modules/install-plan/non-reinstallable.nix)
784781
(import ../modules/install-plan/override-package-by-name.nix)
782+
(import ../modules/install-plan/planned.nix { inherit getComponents; })
785783
(import ../modules/install-plan/redirect.nix)
786784
];
787785
};

0 commit comments

Comments
 (0)