aboutsummaryrefslogtreecommitdiffhomepage
path: root/flake.nix
diff options
context:
space:
mode:
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
+ '';
+ };
});
};
}