summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Eiche <lewo@abesis.fr>2021-07-23 21:25:14 +0200
committerAntoine Eiche <lewo@abesis.fr>2021-07-28 21:35:58 +0200
commit42db23553d433646398ca08e9c61071d01d3350f (patch)
treef15abef3d9631be4a36278d7ed079e890251ca7a
parent68b9397a305c9e2e3c0f1048ee6e4907bc76d2d0 (diff)
Nixify the documentation buildrst-options
-rw-r--r--flake.nix26
1 files changed, 26 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
index f340c2f..ef764b5 100644
--- a/flake.nix
+++ b/flake.nix
@@ -56,6 +56,10 @@
modules = [
mailserverModule
{
+ # Because the blockbook package is currently broken (we
+ # don't care about this package but it is part of the
+ # NixOS module evaluation)
+ nixpkgs.config.allowBroken = true;
mailserver.fqdn = "mx.example.com";
}
];
@@ -84,11 +88,33 @@
echo "test: ok" > $out
'';
+ documentation = pkgs.stdenv.mkDerivation {
+ name = "documentation";
+ src = pkgs.lib.sourceByRegex ./docs ["logo.png" "conf.py" "Makefile" ".*rst$"];
+ buildInputs = [(
+ pkgs.python3.withPackages(p: [
+ p.sphinx
+ p.sphinx_rtd_theme
+ ])
+ )];
+ buildPhase = ''
+ cp ${generateRstOptions} options.rst
+ mkdir -p _static
+ # Workaround for https://github.com/sphinx-doc/sphinx/issues/3451
+ export SOURCE_DATE_EPOCH=$(${pkgs.coreutils}/bin/date +%s)
+ make html
+ '';
+ installPhase = ''
+ cp -r _build/html $out
+ '';
+ };
+
in rec {
nixosModules.mailserver = mailserverModule ;
nixosModule = self.nixosModules.mailserver;
hydraJobs.${system} = allTests // {
test-rst-options = testRstOptions;
+ inherit documentation;
};
checks.${system} = allTests;
devShell.${system} = pkgs.mkShell {