move all other packages

This commit is contained in:
Pyrox 2024-06-30 17:43:38 -04:00
parent 5a6ff19e7a
commit 4c67fce376
Signed by untrusted user: pyrox
GPG key ID: 8CDF3F7CAA53A0F5
9 changed files with 46 additions and 70 deletions

View file

@ -8,7 +8,7 @@
}; };
outputs = outputs =
inputs@{ self, ... }: inputs:
inputs.snowfall-lib.mkFlake { inputs.snowfall-lib.mkFlake {
inherit inputs; inherit inputs;
src = ./.; src = ./.;
@ -19,32 +19,5 @@
title = "Aux Manual Generator"; 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 { };
};
};
}; };
} }

View file

@ -1,4 +1,4 @@
{ pkgs, libsets }: { pkgs, ... }:
let let
revision = pkgs.lib.trivial.revisionWithDefault (pkgs.rev or "master"); revision = pkgs.lib.trivial.revisionWithDefault (pkgs.rev or "master");
@ -22,7 +22,7 @@ let
builtins.map (subsetname: { builtins.map (subsetname: {
subsetname = subsetname; subsetname = subsetname;
functions = libDefPos [ ] toplib.${subsetname}; functions = libDefPos [ ] toplib.${subsetname};
}) (builtins.map (x: x.name) libsets); }) (builtins.map (x: x.name) pkgs.libsets);
nixpkgsLib = pkgs.lib; nixpkgsLib = pkgs.lib;

View file

@ -1,9 +1,5 @@
# Generates the documentation for library functions via nixdoc. # Generates the documentation for library functions via nixdoc.
{ { pkgs, inputs, ... }:
pkgs,
libsets,
inputs,
}:
let let
inherit (pkgs) stdenv lib nixdoc; inherit (pkgs) stdenv lib nixdoc;
@ -25,15 +21,10 @@ stdenv.mkDerivation {
else else
nixdoc -c "$name" -d "lib.$name: $description" -l ${pkgs.doc-locations-json} -f "$baseName/default.nix" > "$out/$name.md" nixdoc -c "$name" -d "lib.$name: $description" -l ${pkgs.doc-locations-json} -f "$baseName/default.nix" > "$out/$name.md"
fi fi
echo "$out/$name.md" >> "$out/index.md"
} }
mkdir -p "$out" mkdir -p "$out"
cat > "$out/index.md" << 'EOF'
```{=include=} sections auto-id-prefix=auto-generated
EOF
${lib.concatMapStrings ( ${lib.concatMapStrings (
{ {
name, name,
@ -43,8 +34,6 @@ stdenv.mkDerivation {
'' ''
docgen ${name} ${baseName} ${lib.escapeShellArg description} docgen ${name} ${baseName} ${lib.escapeShellArg description}
'' ''
) libsets} ) pkgs.libsets}
echo '```' >> "$out/index.md"
''; '';
} }

View file

@ -1,4 +1,4 @@
[ _: [
{ {
name = "asserts"; name = "asserts";
description = "assertion functions"; description = "assertion functions";

View file

@ -1,4 +1,4 @@
{ stdenvNoCC }: { stdenvNoCC, ... }:
stdenvNoCC.mkDerivation { stdenvNoCC.mkDerivation {
pname = "aux-manual-assets"; pname = "aux-manual-assets";
version = "0.0.0"; version = "0.0.0";

View file

@ -1,11 +1,12 @@
{ {
lib, lib,
pkgs,
nixos-render-docs, nixos-render-docs,
python3, python3,
perl, perl,
stdenvNoCC, stdenvNoCC,
spkgs,
inputs, inputs,
...
}: }:
stdenvNoCC.mkDerivation { stdenvNoCC.mkDerivation {
name = "nixpkgs-manual-md"; name = "nixpkgs-manual-md";
@ -24,10 +25,10 @@ stdenvNoCC.mkDerivation {
''; '';
postPatch = '' 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" ]; passAsFile = [ "pythonInterpreterTable" ];
@ -36,7 +37,7 @@ stdenvNoCC.mkDerivation {
cat \ cat \
./functions/library.md.in \ ./functions/library.md.in \
${spkgs.lib-docs}/index.md \ ${pkgs.lib-docs}/index.md \
> ./functions/library.md > ./functions/library.md
substitute ./manual.md.in ./manual.md \ substitute ./manual.md.in ./manual.md \
--replace-fail '@MANUAL_VERSION@' '${lib.version}' --replace-fail '@MANUAL_VERSION@' '${lib.version}'
@ -44,7 +45,7 @@ stdenvNoCC.mkDerivation {
mkdir out mkdir out
mkdir out/assets mkdir out/assets
cp ${spkgs.manual-assets}/* out/assets/ cp ${pkgs.manual-assets}/* out/assets/
mv preface.chapter.md out/index.md mv preface.chapter.md out/index.md
mv build-helpers out/build-helpers mv build-helpers out/build-helpers
@ -56,7 +57,7 @@ stdenvNoCC.mkDerivation {
mv hooks out/hooks mv hooks out/hooks
mv languages-frameworks out/languages-frameworks mv languages-frameworks out/languages-frameworks
mkdir out/lib mkdir out/lib
cp ${spkgs.lib-docs}/*.md out/lib/ cp ${pkgs.lib-docs}/*.md out/lib/
rm out/lib/index.md rm out/lib/index.md
mv module-system out/module-system mv module-system out/module-system
mv packages out/packages mv packages out/packages

View file

@ -1,4 +1,4 @@
{ stdenv, inputs }: { stdenv, inputs, ... }:
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "nixpkgs-doc-src"; pname = "nixpkgs-doc-src";
version = "unstable"; version = "unstable";

View file

@ -1,4 +1,4 @@
{ pkgs, inputs }: { pkgs, inputs, ... }:
let let
inherit (pkgs.lib) hasPrefix removePrefix; inherit (pkgs.lib) hasPrefix removePrefix;
in in

View file

@ -1,14 +1,26 @@
# For debugging, run in this directory: {
# nix eval --impure --raw --expr 'import ./python-interpreter-table.nix {}' pkgs ? (
{ pkgs ? (import ../.. { config = { }; overlays = []; }) }: import ../.. {
config = { };
overlays = [ ];
}
),
...
}:
let let
lib = pkgs.lib; lib = pkgs.lib;
inherit (lib.attrsets) attrNames filterAttrs; inherit (lib.attrsets) attrNames filterAttrs;
inherit (lib.lists) elem filter map naturalSort reverseList; inherit (lib.lists)
inherit (lib.strings) concatStringsSep; filter
map
naturalSort
reverseList
;
isPythonInterpreter = name: isPythonInterpreter =
/* NB: Package names that don't follow the regular expression: name:
/*
NB: Package names that don't follow the regular expression:
- `python-cosmopolitan` is not part of `pkgs.pythonInterpreters`. - `python-cosmopolitan` is not part of `pkgs.pythonInterpreters`.
- `_prebuilt` interpreters are used for bootstrapping internally. - `_prebuilt` interpreters are used for bootstrapping internally.
- `python3Minimal` contains python packages, left behind conservatively. - `python3Minimal` contains python packages, left behind conservatively.
@ -16,7 +28,8 @@ let
*/ */
(lib.strings.match "(pypy|python)([[:digit:]]*)" name) != null; (lib.strings.match "(pypy|python)([[:digit:]]*)" name) != null;
interpreterName = pname: interpreterName =
pname:
let let
cuteName = { cuteName = {
cpython = "CPython"; cpython = "CPython";
@ -26,16 +39,15 @@ let
in in
"${cuteName.${interpreter.implementation}} ${interpreter.pythonVersion}"; "${cuteName.${interpreter.implementation}} ${interpreter.pythonVersion}";
interpreters = reverseList (naturalSort ( interpreters = reverseList (
filter isPythonInterpreter (attrNames pkgs.pythonInterpreters) naturalSort (filter isPythonInterpreter (attrNames pkgs.pythonInterpreters))
)); );
aliases = pname: aliases =
pname:
attrNames ( attrNames (
filterAttrs (name: value: filterAttrs (
isPythonInterpreter name name: _: isPythonInterpreter name && name != pname && interpreterName name == interpreterName pname
&& name != pname
&& interpreterName name == interpreterName pname
) pkgs ) pkgs
); );
@ -45,7 +57,8 @@ let
interpreter = interpreterName pname; interpreter = interpreterName pname;
}) interpreters; }) interpreters;
toMarkdown = data: toMarkdown =
data:
let let
line = package: '' line = package: ''
| ${package.pname} | ${join ", " package.aliases or [ ]} | ${package.interpreter} | | ${package.pname} | ${join ", " package.aliases or [ ]} | ${package.interpreter} |