Add bundlers.list

This commit is contained in:
Tim Van Baak 2024-07-11 06:40:31 -07:00
parent 2c1b4de20f
commit aae8892a4a
2 changed files with 20 additions and 12 deletions

View File

@ -1,7 +1,4 @@
{ { pkgs, ... }:
pkgs,
...
}:
let let
inherit (builtins) inherit (builtins)
genericClosure genericClosure
@ -14,6 +11,7 @@ let
concatLines concatLines
concatLists concatLists
concatMap concatMap
concatStringsSep
filter filter
isDerivation isDerivation
isList isList
@ -45,14 +43,8 @@ rec {
startSet = map wrap (drvOutputs drv); startSet = map wrap (drvOutputs drv);
operator = obj: map wrap (concatLists (drvDeps obj.drv.drvAttrs)); operator = obj: map wrap (concatLists (drvDeps obj.drv.drvAttrs));
}); });
drvMaintainers = maintainable = drv: hasAttr "meta" drv && hasAttr "maintainers" drv.meta;
drv: drvMaintainers = drv: if maintainable drv then drv.meta.maintainers else [ ];
if !hasAttr "meta" drv then
[ ]
else if !hasAttr "maintainers" drv.meta then
[ ]
else
drv.meta.maintainers;
nobodyMaintains = nobodyMaintains =
drv: hasAttr "meta" drv && hasAttr "maintainers" drv.meta && (length drv.meta.maintainers) == 0; drv: hasAttr "meta" drv && hasAttr "maintainers" drv.meta && (length drv.meta.maintainers) == 0;
stringJoin = objToString: objs: writeText "txt" (concatLines (map objToString objs)); stringJoin = objToString: objs: writeText "txt" (concatLines (map objToString objs));
@ -82,4 +74,19 @@ rec {
| ${pkgs.unixtools.column}/bin/column -t \ | ${pkgs.unixtools.column}/bin/column -t \
> $out > $out
''; '';
listMaintainers =
drv:
let
closure = drvClosure drv;
maintainableDrvs = filter maintainable closure;
maintainersToString =
maintainers: concatStringsSep "," (map (main: toString main.github) maintainers);
drvToString = drv: "${drv.name} ${maintainersToString (drvMaintainers drv)}";
in
runCommandLocal "maintainers.txt" { } ''
<${stringJoin drvToString maintainableDrvs} sort -u \
| ${pkgs.unixtools.column}/bin/column -t \
> $out
'';
} }

View File

@ -11,6 +11,7 @@
default = adopt; default = adopt;
maintainers = lib.allMaintainers; maintainers = lib.allMaintainers;
adopt = lib.noMaintainers; adopt = lib.noMaintainers;
list = lib.listMaintainers;
}; };
formatter."x86_64-linux" = pkgs.nixfmt-rfc-style; formatter."x86_64-linux" = pkgs.nixfmt-rfc-style;