docs: refactor, move out of flake.nix

also filter source to limit rebuilds
This commit is contained in:
zowoq 2024-05-25 10:15:05 +10:00
parent 7294a7afc9
commit 3fcadaf275
4 changed files with 31 additions and 18 deletions

27
dev/docs.nix Normal file
View file

@ -0,0 +1,27 @@
{ config, pkgs, ... }:
{
devShells.mkdocs = pkgs.mkShellNoCC {
inputsFrom = [
config.packages.docs
];
};
packages = {
docs = pkgs.runCommand "docs"
{
buildInputs = [
pkgs.python3.pkgs.mkdocs-material
];
files = pkgs.lib.fileset.toSource {
root = ../.;
fileset = pkgs.lib.fileset.unions [
../docs
../mkdocs.yml
];
};
}
''
cd $files
mkdocs build --strict --site-dir $out
'';
};
}