refactor modules
This commit is contained in:
32
modules/docs.nix
Normal file
32
modules/docs.nix
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
self,
|
||||
inputs,
|
||||
...
|
||||
}: {
|
||||
perSystem = {
|
||||
pkgs,
|
||||
lib,
|
||||
system,
|
||||
...
|
||||
}: {
|
||||
packages.docs = let
|
||||
nixos = inputs.nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules =
|
||||
[
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
]
|
||||
++ lib.attrValues self.nixosModules;
|
||||
};
|
||||
doc = pkgs.nixosOptionsDoc {options.hive = nixos.options.hive;};
|
||||
in
|
||||
pkgs.stdenvNoCC.mkDerivation {
|
||||
name = ".hive-docs";
|
||||
buildCommand = ''
|
||||
mkdir -p $out
|
||||
cp ${doc.optionsCommonMark} $out/docs.md
|
||||
${pkgs.pandoc}/bin/pandoc -o $out/docs.html $out/docs.md
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user