diff options
author | Silvan Mosberger <silvan.mosberger@tweag.io> | 2024-06-14 20:22:38 +0200 |
---|---|---|
committer | Valentin Gagarin <valentin.gagarin@tweag.io> | 2024-06-15 16:35:12 +0200 |
commit | b59560c3f8155ecf0a564f56f3e0ec26dc746202 (patch) | |
tree | e601dc6af8be2d52d6fb43683442f71000423b33 /doc | |
parent | 33f93a899903b55ce45ad2728a8c215b4467bcb4 (diff) |
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
Diffstat (limited to 'doc')
-rw-r--r-- | doc/default.nix | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/doc/default.nix b/doc/default.nix index 14c828b02a061..369220dcc5365 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 \ |