mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-19 18:44:13 +00:00
doc: Use build-time to insert dynamic python interpreter table
Nix eval isn't made to patch stuff, it's more flexible to do it at build time
This commit is contained in:
parent
33f93a8999
commit
b59560c3f8
@ -105,14 +105,12 @@ in pkgs.stdenv.mkDerivation {
|
||||
ln -s ${optionsDoc.optionsJSON}/share/doc/nixos/options.json ./config-options.json
|
||||
'';
|
||||
|
||||
buildPhase = let
|
||||
pythonInterpreterTable = pkgs.callPackage ./doc-support/python-interpreter-table.nix {};
|
||||
pythonSection = with lib.strings; replaceStrings
|
||||
[ "@python-interpreter-table@" ]
|
||||
[ pythonInterpreterTable ]
|
||||
(readFile ./languages-frameworks/python.section.md);
|
||||
in ''
|
||||
cp ${builtins.toFile "python.section.md" pythonSection} ./languages-frameworks/python.section.md
|
||||
pythonInterpreterTable = pkgs.callPackage ./doc-support/python-interpreter-table.nix {};
|
||||
|
||||
passAsFile = [ "pythonInterpreterTable" ];
|
||||
|
||||
buildPhase = ''
|
||||
substituteInPlace ./languages-frameworks/python.section.md --subst-var-by python-interpreter-table "$(<"$pythonInterpreterTablePath")"
|
||||
|
||||
cat \
|
||||
./functions/library.md.in \
|
||||
|
Loading…
Reference in New Issue
Block a user