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
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -28,6 +28,7 @@
|
||||
description = "The user for the borg repository home.";
|
||||
};
|
||||
repositories = lib.mkOption {
|
||||
description = "The borg repositories to serve";
|
||||
type = lib.types.attrsOf (lib.types.submodule {
|
||||
options = {
|
||||
name = lib.mkOption {
|
||||
|
||||
Reference in New Issue
Block a user