doc: Prevent unnecessary rebuilds

Especially when only Nix files are changed
This commit is contained in:
Silvan Mosberger 2024-06-14 20:33:43 +02:00 committed by Valentin Gagarin
parent be6f553b7d
commit 3da97e2163

View File

@ -2,6 +2,7 @@
let
inherit (pkgs) lib;
inherit (lib) hasPrefix removePrefix;
fs = lib.fileset;
common = import ./common.nix;
@ -99,7 +100,19 @@ in pkgs.stdenv.mkDerivation {
nixos-render-docs
];
src = ./.;
src = fs.toSource {
root = ./.;
fileset = fs.unions [
(fs.fileFilter (file:
file.hasExt "md"
|| file.hasExt "md.in"
) ./.)
./style.css
./anchor-use.js
./anchor.min.js
./manpage-urls.json
];
};
postPatch = ''
ln -s ${optionsDoc.optionsJSON}/share/doc/nixos/options.json ./config-options.json