docs: drop options.md from the repository

Generate the file on the readthedocs builder using Nix. Since there is
no root access or user namespaces, we have to use proot (see
https://nixos.wiki/wiki/Nix_Installation_Guide#PRoot).
This commit is contained in:
Naïm Favier 2022-12-01 14:22:27 +01:00
parent 4fcab839d7
commit 0bbb2ac74e
No known key found for this signature in database
GPG key ID: 95AFCE8211908325
4 changed files with 20 additions and 1237 deletions

View file

@ -81,22 +81,6 @@
python ${./scripts/generate-options.py} ${options} > $out
'';
# This is a script helping users to generate this file in the docs directory
generateOptions = pkgs.writeShellScriptBin "generate-options" ''
install -vm644 ${optionsDoc} ./docs/options.md
'';
# This is to ensure we don't forget to update the options.md file
testOptions = pkgs.runCommand "test-options" {} ''
if ! diff -q ${./docs/options.md} ${optionsDoc}
then
echo "The file ./docs/options.md is not up-to-date and needs to be regenerated!"
echo " hint: run 'nix-shell --run generate-options' to generate this file"
exit 1
fi
echo "test: ok" > $out
'';
documentation = pkgs.stdenv.mkDerivation {
name = "documentation";
src = lib.sourceByRegex ./docs ["logo\\.png" "conf\\.py" "Makefile" ".*\\.rst"];
@ -125,14 +109,15 @@
};
nixosModule = self.nixosModules.default; # compatibility
hydraJobs.${system} = allTests // {
test-options = testOptions;
inherit documentation;
};
checks.${system} = allTests;
packages.${system} = {
inherit optionsDoc documentation;
};
devShells.${system}.default = pkgs.mkShell {
inputsFrom = [ documentation ];
packages = with pkgs; [
generateOptions
clamav
];
};