mirror of
https://git.gay/pyrox/aux-docs
synced 2024-10-30 00:27:57 +00:00
move all other packages
This commit is contained in:
parent
5a6ff19e7a
commit
4c67fce376
29
flake.nix
29
flake.nix
|
@ -8,7 +8,7 @@
|
|||
};
|
||||
|
||||
outputs =
|
||||
inputs@{ self, ... }:
|
||||
inputs:
|
||||
inputs.snowfall-lib.mkFlake {
|
||||
inherit inputs;
|
||||
src = ./.;
|
||||
|
@ -19,32 +19,5 @@
|
|||
title = "Aux Manual Generator";
|
||||
};
|
||||
};
|
||||
outputs-builder =
|
||||
channels:
|
||||
let
|
||||
pkgs = channels.nixpkgs;
|
||||
spkgs = self.packages.${pkgs.system};
|
||||
libsets = (import ./nixpkgs-doc/libsets.nix);
|
||||
in
|
||||
{
|
||||
packages = {
|
||||
lib-docs = pkgs.callPackage ./nixpkgs-doc/doc-support/lib-function-docs.nix {
|
||||
inherit
|
||||
libsets
|
||||
pkgs
|
||||
spkgs
|
||||
inputs
|
||||
;
|
||||
};
|
||||
doc-locations-json = pkgs.callPackage ./nixpkgs-doc/doc-support/lib-function-locations.nix {
|
||||
inherit libsets pkgs;
|
||||
};
|
||||
md-manual = pkgs.callPackage ./nixpkgs-doc/md-manual.nix { inherit spkgs inputs; };
|
||||
python-interp-table = pkgs.callPackage ./nixpkgs-doc/doc-support/python-interpreter-table.nix { };
|
||||
options-doc = pkgs.callPackage ./nixpkgs-doc/options-doc.nix { inherit pkgs inputs; };
|
||||
nixpkgs-doc = pkgs.callPackage ./nixpkgs-doc/nixpkgs-doc.nix { inherit inputs; };
|
||||
manual-assets = pkgs.callPackage ./nixpkgs-doc/manual-assets.nix { };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, libsets }:
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
revision = pkgs.lib.trivial.revisionWithDefault (pkgs.rev or "master");
|
||||
|
||||
|
@ -22,7 +22,7 @@ let
|
|||
builtins.map (subsetname: {
|
||||
subsetname = subsetname;
|
||||
functions = libDefPos [ ] toplib.${subsetname};
|
||||
}) (builtins.map (x: x.name) libsets);
|
||||
}) (builtins.map (x: x.name) pkgs.libsets);
|
||||
|
||||
nixpkgsLib = pkgs.lib;
|
||||
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
# Generates the documentation for library functions via nixdoc.
|
||||
{
|
||||
pkgs,
|
||||
libsets,
|
||||
inputs,
|
||||
}:
|
||||
{ pkgs, inputs, ... }:
|
||||
let
|
||||
|
||||
inherit (pkgs) stdenv lib nixdoc;
|
||||
|
@ -25,15 +21,10 @@ stdenv.mkDerivation {
|
|||
else
|
||||
nixdoc -c "$name" -d "lib.$name: $description" -l ${pkgs.doc-locations-json} -f "$baseName/default.nix" > "$out/$name.md"
|
||||
fi
|
||||
echo "$out/$name.md" >> "$out/index.md"
|
||||
}
|
||||
|
||||
mkdir -p "$out"
|
||||
|
||||
cat > "$out/index.md" << 'EOF'
|
||||
```{=include=} sections auto-id-prefix=auto-generated
|
||||
EOF
|
||||
|
||||
${lib.concatMapStrings (
|
||||
{
|
||||
name,
|
||||
|
@ -43,8 +34,6 @@ stdenv.mkDerivation {
|
|||
''
|
||||
docgen ${name} ${baseName} ${lib.escapeShellArg description}
|
||||
''
|
||||
) libsets}
|
||||
|
||||
echo '```' >> "$out/index.md"
|
||||
) pkgs.libsets}
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[
|
||||
_: [
|
||||
{
|
||||
name = "asserts";
|
||||
description = "assertion functions";
|
|
@ -1,4 +1,4 @@
|
|||
{ stdenvNoCC }:
|
||||
{ stdenvNoCC, ... }:
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "aux-manual-assets";
|
||||
version = "0.0.0";
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
nixos-render-docs,
|
||||
python3,
|
||||
perl,
|
||||
stdenvNoCC,
|
||||
spkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
stdenvNoCC.mkDerivation {
|
||||
name = "nixpkgs-manual-md";
|
||||
|
@ -24,10 +25,10 @@ stdenvNoCC.mkDerivation {
|
|||
'';
|
||||
|
||||
postPatch = ''
|
||||
ln -s ${spkgs.options-doc.optionsJSON}/share/doc/nixos/options.json ./config-options.json
|
||||
ln -s ${pkgs.options-doc.optionsJSON}/share/doc/nixos/options.json ./config-options.json
|
||||
'';
|
||||
|
||||
pythonInterpreterTable = spkgs.python-interp-table;
|
||||
pythonInterpreterTable = pkgs.python-interp-table;
|
||||
|
||||
passAsFile = [ "pythonInterpreterTable" ];
|
||||
|
||||
|
@ -36,7 +37,7 @@ stdenvNoCC.mkDerivation {
|
|||
|
||||
cat \
|
||||
./functions/library.md.in \
|
||||
${spkgs.lib-docs}/index.md \
|
||||
${pkgs.lib-docs}/index.md \
|
||||
> ./functions/library.md
|
||||
substitute ./manual.md.in ./manual.md \
|
||||
--replace-fail '@MANUAL_VERSION@' '${lib.version}'
|
||||
|
@ -44,7 +45,7 @@ stdenvNoCC.mkDerivation {
|
|||
mkdir out
|
||||
|
||||
mkdir out/assets
|
||||
cp ${spkgs.manual-assets}/* out/assets/
|
||||
cp ${pkgs.manual-assets}/* out/assets/
|
||||
|
||||
mv preface.chapter.md out/index.md
|
||||
mv build-helpers out/build-helpers
|
||||
|
@ -56,7 +57,7 @@ stdenvNoCC.mkDerivation {
|
|||
mv hooks out/hooks
|
||||
mv languages-frameworks out/languages-frameworks
|
||||
mkdir out/lib
|
||||
cp ${spkgs.lib-docs}/*.md out/lib/
|
||||
cp ${pkgs.lib-docs}/*.md out/lib/
|
||||
rm out/lib/index.md
|
||||
mv module-system out/module-system
|
||||
mv packages out/packages
|
|
@ -1,4 +1,4 @@
|
|||
{ stdenv, inputs }:
|
||||
{ stdenv, inputs, ... }:
|
||||
stdenv.mkDerivation {
|
||||
pname = "nixpkgs-doc-src";
|
||||
version = "unstable";
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, inputs }:
|
||||
{ pkgs, inputs, ... }:
|
||||
let
|
||||
inherit (pkgs.lib) hasPrefix removePrefix;
|
||||
in
|
|
@ -1,14 +1,26 @@
|
|||
# For debugging, run in this directory:
|
||||
# nix eval --impure --raw --expr 'import ./python-interpreter-table.nix {}'
|
||||
{ pkgs ? (import ../.. { config = { }; overlays = []; }) }:
|
||||
{
|
||||
pkgs ? (
|
||||
import ../.. {
|
||||
config = { };
|
||||
overlays = [ ];
|
||||
}
|
||||
),
|
||||
...
|
||||
}:
|
||||
let
|
||||
lib = pkgs.lib;
|
||||
inherit (lib.attrsets) attrNames filterAttrs;
|
||||
inherit (lib.lists) elem filter map naturalSort reverseList;
|
||||
inherit (lib.strings) concatStringsSep;
|
||||
inherit (lib.lists)
|
||||
filter
|
||||
map
|
||||
naturalSort
|
||||
reverseList
|
||||
;
|
||||
|
||||
isPythonInterpreter = name:
|
||||
/* NB: Package names that don't follow the regular expression:
|
||||
isPythonInterpreter =
|
||||
name:
|
||||
/*
|
||||
NB: Package names that don't follow the regular expression:
|
||||
- `python-cosmopolitan` is not part of `pkgs.pythonInterpreters`.
|
||||
- `_prebuilt` interpreters are used for bootstrapping internally.
|
||||
- `python3Minimal` contains python packages, left behind conservatively.
|
||||
|
@ -16,7 +28,8 @@ let
|
|||
*/
|
||||
(lib.strings.match "(pypy|python)([[:digit:]]*)" name) != null;
|
||||
|
||||
interpreterName = pname:
|
||||
interpreterName =
|
||||
pname:
|
||||
let
|
||||
cuteName = {
|
||||
cpython = "CPython";
|
||||
|
@ -26,16 +39,15 @@ let
|
|||
in
|
||||
"${cuteName.${interpreter.implementation}} ${interpreter.pythonVersion}";
|
||||
|
||||
interpreters = reverseList (naturalSort (
|
||||
filter isPythonInterpreter (attrNames pkgs.pythonInterpreters)
|
||||
));
|
||||
interpreters = reverseList (
|
||||
naturalSort (filter isPythonInterpreter (attrNames pkgs.pythonInterpreters))
|
||||
);
|
||||
|
||||
aliases = pname:
|
||||
aliases =
|
||||
pname:
|
||||
attrNames (
|
||||
filterAttrs (name: value:
|
||||
isPythonInterpreter name
|
||||
&& name != pname
|
||||
&& interpreterName name == interpreterName pname
|
||||
filterAttrs (
|
||||
name: _: isPythonInterpreter name && name != pname && interpreterName name == interpreterName pname
|
||||
) pkgs
|
||||
);
|
||||
|
||||
|
@ -45,7 +57,8 @@ let
|
|||
interpreter = interpreterName pname;
|
||||
}) interpreters;
|
||||
|
||||
toMarkdown = data:
|
||||
toMarkdown =
|
||||
data:
|
||||
let
|
||||
line = package: ''
|
||||
| ${package.pname} | ${join ", " package.aliases or [ ]} | ${package.interpreter} |
|
Loading…
Reference in a new issue