Compare commits
No commits in common. "185a541c590b8730d28cbe9866e83e5044aae80b" and "30caf6f8bec1ce36edf105cb8714470675476a0f" have entirely different histories.
185a541c59
...
30caf6f8be
23
flake.nix
23
flake.nix
|
@ -18,10 +18,10 @@
|
||||||
else []
|
else []
|
||||||
) attrs;
|
) attrs;
|
||||||
wrap = drv: { key = drv.outPath; inherit drv; };
|
wrap = drv: { key = drv.outPath; inherit drv; };
|
||||||
buildtimeDerivations = drv0: map (obj: obj.drv) (genericClosure {
|
buildtimeDerivations = drv0: genericClosure {
|
||||||
startSet = map wrap (drvOutputs drv0);
|
startSet = map wrap (drvOutputs drv0);
|
||||||
operator = obj: map wrap (concatLists (drvDeps obj.drv.drvAttrs));
|
operator = obj: map wrap (concatLists (drvDeps obj.drv.drvAttrs));
|
||||||
});
|
};
|
||||||
drvMaintainers = drv:
|
drvMaintainers = drv:
|
||||||
if ! hasAttr "meta" drv then []
|
if ! hasAttr "meta" drv then []
|
||||||
else if ! hasAttr "maintainers" drv.meta then []
|
else if ! hasAttr "maintainers" drv.meta then []
|
||||||
|
@ -30,30 +30,29 @@
|
||||||
hasAttr "meta" drv &&
|
hasAttr "meta" drv &&
|
||||||
hasAttr "maintainers" drv.meta &&
|
hasAttr "maintainers" drv.meta &&
|
||||||
(length drv.meta.maintainers) == 0;
|
(length drv.meta.maintainers) == 0;
|
||||||
stringJoin = objToString: objs: writeText "txt" (concatLines (map objToString objs));
|
|
||||||
maintainerToString = m: "${m.name} (${m.email})";
|
maintainerToString = m: "${m.name} (${m.email})";
|
||||||
drvToString = drv: "${drv.name}";
|
drvToString = drv: "${drv.name}";
|
||||||
};
|
};
|
||||||
bundlers."x86_64-linux" = with self.lib; rec {
|
bundlers."x86_64-linux" = with self.lib; rec {
|
||||||
default = adopt;
|
default = adopt;
|
||||||
maintainers = drv: let
|
maintainers = drv: let
|
||||||
drvs = buildtimeDerivations drv;
|
deps = buildtimeDerivations drv;
|
||||||
|
drvs = map (dep: dep.drv) deps;
|
||||||
maintainers = concatMap drvMaintainers drvs;
|
maintainers = concatMap drvMaintainers drvs;
|
||||||
maintainerNamesList = stringJoin (m: "${m.name} (${m.email})") maintainers;
|
maintainerNames = map maintainerToString maintainers;
|
||||||
|
maintainerNamesList = writeText "maintainers" (concatLines maintainerNames);
|
||||||
uniqNames = runCommandLocal "uniq-maintainers.txt" {} ''
|
uniqNames = runCommandLocal "uniq-maintainers.txt" {} ''
|
||||||
<${maintainerNamesList} sort | uniq -c > $out
|
<${maintainerNamesList} sort | uniq -c > $out
|
||||||
'';
|
'';
|
||||||
in uniqNames;
|
in uniqNames;
|
||||||
adopt = drv: let
|
adopt = drv: let
|
||||||
drvs = buildtimeDerivations drv;
|
deps = buildtimeDerivations drv;
|
||||||
|
drvs = map (dep: dep.drv) deps;
|
||||||
drvsNoMain = filter nobodyMaintains drvs;
|
drvsNoMain = filter nobodyMaintains drvs;
|
||||||
drvNamesList = stringJoin (drv: "${drv.name} ${drv.meta.position}") drvsNoMain;
|
drvNames = map drvToString drvsNoMain;
|
||||||
|
drvNamesList = writeText "no-maintainers" (concatLines drvNames);
|
||||||
uniqNames = runCommandLocal "no-maintainers.txt" {} ''
|
uniqNames = runCommandLocal "no-maintainers.txt" {} ''
|
||||||
<${drvNamesList} sort -u \
|
<${drvNamesList} sort -u > $out
|
||||||
| sed 's/\/nix\/store\/[^/]*/https:\/\/github.com\/NixOS\/nixpkgs\/blob\/master/' \
|
|
||||||
| sed 's/.nix:\(.*\)$/#L\1/' \
|
|
||||||
| ${pkgs.unixtools.column}/bin/column -t \
|
|
||||||
> $out
|
|
||||||
'';
|
'';
|
||||||
in uniqNames;
|
in uniqNames;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue