diff --git a/doc/default.nix b/doc/default.nix index 14c828b02a06..369220dcc536 100644 --- a/doc/default.nix +++ b/doc/default.nix @@ -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 \