anchor.diff:        allowedReferences = ["out"];
       }
       ''
  -      ${copySources}
  -
  -      # Check the validity of the man pages sources.
  -      xmllint --noout --nonet --xinclude --noxincludenode \
  -        --relaxng ${docbook5}/xml/rng/docbook/docbook.rng \
  -        ./man-pages.xml
  -
         # Generate manpages.
         mkdir -p $out/share/man
  -      xsltproc --nonet --xinclude \
  +      xsltproc --nonet \
           --param man.output.in.separate.dir 1 \
           --param man.output.base.dir "'$out/share/man/'" \
           --param man.endnotes.are.numbered 0 \
           --param man.break.after.slash 1 \
           --stringparam target.database.document "${olinkDB}/olinkdb.xml" \
           ${docbook5_xsl}/xml/xsl/docbook/manpages/docbook.xsl \
  -        ./man-pages.xml
  +        ${manual-combined}/man-pages-combined.xml
       '';
   
   }
  
positive.code:     "--stringparam chunk.toc ${toc}"
    ];
  
    olinkDB = runCommand "manual-olinkdb"
      { inherit sources;
        buildInputs = [ libxml2 libxslt ];
      }
      ''
        ${copySources}
  
        xsltproc \
          ${manualXsltprocOptions} \
          --stringparam collect.xref.targets only \
          --stringparam targets.filename "$out/manual.db" \
          --nonet --xinclude \
          ${docbook5_xsl}/xml/xsl/docbook/xhtml/chunktoc.xsl \
          ./manual.xml
  
        # Check the validity of the man pages sources.
        xmllint --noout --nonet --xinclude --noxincludenode \
          --relaxng ${docbook5}/xml/rng/docbook/docbook.rng \
          ./man-pages.xml
  
        cat > "$out/olinkdb.xml" <<EOF
        <?xml version="1.0" encoding="utf-8"?>
  
negative.code:       allowedReferences = ["out"];
      }
      ''
        # Generate the HTML manual.
        dst=$out/share/doc/nixos
        mkdir -p $dst
        xsltproc \
          ${manualXsltprocOptions} \
          --stringparam target.database.document "${olinkDB}/olinkdb.xml" \
          --nonet --output $dst/ \
          ${docbook5_xsl}/xml/xsl/docbook/xhtml/chunktoc.xsl \
          ${manual-combined}/manual-combined.xml
  
        mkdir -p $dst/images/callouts
        cp ${docbook5_xsl}/xml/xsl/docbook/images/callouts/*.gif $dst/images/callouts/
  