aboutsummaryrefslogtreecommitdiffhomepage
path: root/flake.nix
diff options
context:
space:
mode:
authorOphestra Umiker <cat@ophivana.moe>2024-11-19 18:12:35 +0900
committerOphestra Umiker <cat@ophivana.moe>2024-11-19 18:12:35 +0900
commit0a546885e3a2d1b5a1733122065abd11f3d81266 (patch)
tree47faf8b19deac6bbb5c89789b298da84bba489e7 /flake.nix
parent653d69da0a268ea1673ff9830b2508a5a9241040 (diff)
nix: update options doc
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
index ba6c0c83..69c5514c 100644
--- a/flake.nix
+++ b/flake.nix
@@ -42,6 +42,33 @@
with nixpkgsFor.${system};
self.packages.${system}.fortify.buildInputs ++ [ self.packages.${system}.fortify ];
};
+
+ generateDoc =
+ let
+ pkgs = nixpkgsFor.${system};
+ inherit (pkgs) lib;
+
+ doc =
+ let
+ eval = lib.evalModules {
+ specialArgs = {
+ inherit pkgs;
+ };
+ modules = [ ./options.nix ];
+ };
+ cleanEval = lib.filterAttrsRecursive (n: v: n != "_module") eval;
+ in
+ pkgs.nixosOptionsDoc { inherit (cleanEval) options; };
+ docText = pkgs.runCommand "fortify-module-docs.md" { } ''
+ cat ${doc.optionsCommonMark} > $out
+ sed -i '/*Declared by:*/,+1 d' $out
+ '';
+ in
+ nixpkgsFor.${system}.mkShell {
+ shellHook = ''
+ exec cat ${docText} > options.md
+ '';
+ };
});
};
}