nixos-configs/apps/gen-docs/getScopesMeta.nix
matt1432 138a6637e2
All checks were successful
Discord / discord commits (push) Has been skipped
fix(docs): adjust script to overlay changes
2025-03-05 23:22:06 -05:00

31 lines
842 B
Nix

attr: selfPath: let
inherit (builtins) currentSystem getFlake mapAttrs removeAttrs replaceStrings;
self = getFlake selfPath;
scopes = ((import "${selfPath}/${attr}" {description = true;}) {} {}).scopedPackages;
trimNewlines = s: replaceStrings ["\n"] [" "] s;
in {
attrs =
mapAttrs (n: v: {
desc = trimNewlines v;
packages = let
scopePkgs = removeAttrs self.${attr}.${currentSystem}.${n} [
"buildFirefoxXpiAddon"
"callPackage"
"newScope"
"override"
"overrideDerivation"
"overrideScope"
"packages"
"recurseForDerivations"
];
in
mapAttrs (_: pkg: {
desc = trimNewlines (pkg.meta.description or "");
homepage = pkg.meta.homepage or "";
})
scopePkgs;
})
scopes;
}