File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -755,12 +755,22 @@ final: prev: {
755
755
name = to-key p ;
756
756
value = {
757
757
components = final . lib . optionalAttrs ( config . packages ? ${ p . pkg-name } ) (
758
- builtins . mapAttrs ( _ : x : builtins . mapAttrs ( _ : x : final . lib . mkOverride 990 x )
759
- ( builtins . removeAttrs x [ "buildable" "planned" "depends" "build-tools" ] ) )
760
- ( final . lib . filterAttrs ( _ : x : x != null ) config . packages . ${ p . pkg-name } . components ) ) ;
758
+ let
759
+ inherit ( config . packages . ${ p . pkg-name } ) components ;
760
+ mapOptions = c :
761
+ builtins . mapAttrs ( _ : x : final . lib . mkOverride 990 x )
762
+ ( builtins . removeAttrs c [ "buildable" "planned" "depends" "build-tools" ] ) //
763
+ builtins . mapAttrs ( n : x : final . lib . mkOverride 90 x ) (
764
+ final . lib . filterAttrs ( n : x : builtins . elem n [ "depends" "build-tools" ] && builtins . length x != 0 ) c ) ;
765
+ in
766
+ final . lib . optionalAttrs ( components . library or null != null ) {
767
+ library = mapOptions components . library ;
768
+ } // final . lib . optionalAttrs ( components . setup or null != null ) {
769
+ setup = mapOptions components . setup ;
770
+ } // builtins . mapAttrs ( ctype : cs : builtins . mapAttrs ( cname : c : __trace "${ ctype } ${ cname } " mapOptions c ) cs ) ( builtins . removeAttrs components [ "library" "setup" ] ) ) ;
761
771
} // builtins . mapAttrs ( n : _ :
762
- final . lib . mkIf ( config . packages ? ${ p . pkg-name } ) ( final . lib . mkOverride 995 config . packages . ${ p . pkg-name } . ${ n } ) )
763
- ( import ../modules/package-options.nix { inherit haskellLib ; inherit ( final ) lib ; } ) . options ;
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 } ) )
773
+ ( ( import ../modules/package-options.nix { inherit haskellLib ; inherit ( final ) lib ; } ) . options // { src = { } ; } ) ;
764
774
} ) ( final . lib . filter ( p : to-key p != p . pkg-name ) plan-json . install-plan ) ) ;
765
775
} )
766
776
( { lib , ...} : {
You can’t perform that action at this time.
0 commit comments