Compare commits
3 Commits
30caf6f8be
...
185a541c59
Author | SHA1 | Date |
---|---|---|
Tim Van Baak | 185a541c59 | |
Tim Van Baak | 0670b65fff | |
Tim Van Baak | 1315e8fab8 |
23
flake.nix
23
flake.nix
|
@ -18,10 +18,10 @@
|
|||
else []
|
||||
) attrs;
|
||||
wrap = drv: { key = drv.outPath; inherit drv; };
|
||||
buildtimeDerivations = drv0: genericClosure {
|
||||
buildtimeDerivations = drv0: map (obj: obj.drv) (genericClosure {
|
||||
startSet = map wrap (drvOutputs drv0);
|
||||
operator = obj: map wrap (concatLists (drvDeps obj.drv.drvAttrs));
|
||||
};
|
||||
});
|
||||
drvMaintainers = drv:
|
||||
if ! hasAttr "meta" drv then []
|
||||
else if ! hasAttr "maintainers" drv.meta then []
|
||||
|
@ -30,29 +30,30 @@
|
|||
hasAttr "meta" drv &&
|
||||
hasAttr "maintainers" drv.meta &&
|
||||
(length drv.meta.maintainers) == 0;
|
||||
stringJoin = objToString: objs: writeText "txt" (concatLines (map objToString objs));
|
||||
maintainerToString = m: "${m.name} (${m.email})";
|
||||
drvToString = drv: "${drv.name}";
|
||||
};
|
||||
bundlers."x86_64-linux" = with self.lib; rec {
|
||||
default = adopt;
|
||||
maintainers = drv: let
|
||||
deps = buildtimeDerivations drv;
|
||||
drvs = map (dep: dep.drv) deps;
|
||||
drvs = buildtimeDerivations drv;
|
||||
maintainers = concatMap drvMaintainers drvs;
|
||||
maintainerNames = map maintainerToString maintainers;
|
||||
maintainerNamesList = writeText "maintainers" (concatLines maintainerNames);
|
||||
maintainerNamesList = stringJoin (m: "${m.name} (${m.email})") maintainers;
|
||||
uniqNames = runCommandLocal "uniq-maintainers.txt" {} ''
|
||||
<${maintainerNamesList} sort | uniq -c > $out
|
||||
'';
|
||||
in uniqNames;
|
||||
adopt = drv: let
|
||||
deps = buildtimeDerivations drv;
|
||||
drvs = map (dep: dep.drv) deps;
|
||||
drvs = buildtimeDerivations drv;
|
||||
drvsNoMain = filter nobodyMaintains drvs;
|
||||
drvNames = map drvToString drvsNoMain;
|
||||
drvNamesList = writeText "no-maintainers" (concatLines drvNames);
|
||||
drvNamesList = stringJoin (drv: "${drv.name} ${drv.meta.position}") drvsNoMain;
|
||||
uniqNames = runCommandLocal "no-maintainers.txt" {} ''
|
||||
<${drvNamesList} sort -u > $out
|
||||
<${drvNamesList} sort -u \
|
||||
| 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;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue