From d566e9e9377d5110874ec4df05350cb74ee3b2b0 Mon Sep 17 00:00:00 2001 From: Sk7Str1p3 Date: Sun, 26 Jul 2026 19:28:38 +0000 Subject: [PATCH 1/2] feat(docs): link module definition path to repository --- docs/docgen.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/docgen.nix b/docs/docgen.nix index b63b181..9522095 100644 --- a/docs/docgen.nix +++ b/docs/docgen.nix @@ -79,6 +79,21 @@ stdenvNoCC.mkDerivation { moduleOptionsDoc = (nixosOptionsDoc { options = lib.removeAttrs modulesEval.options [ "_module" ]; + transformOptions = + opt: + opt + // { + declarations = map ( + decl: + let + file = toString decl; + in + { + name = relPath file; + url = "https://git.shellgod.icu/Sk7Str1p3/nixos/src/branch/main/${relPath file}"; + } + ) opt.declarations; + }; }).optionsCommonMark; in { From d1d6468e190ac420c44bc978451b7b315f86e99a Mon Sep 17 00:00:00 2001 From: Sk7Str1p3 Date: Sun, 26 Jul 2026 19:36:07 +0000 Subject: [PATCH 2/2] feat(docs): control whether to link modules definition to git repository --- docs/docgen.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/docgen.nix b/docs/docgen.nix index 9522095..f9de95d 100644 --- a/docs/docgen.nix +++ b/docs/docgen.nix @@ -9,6 +9,7 @@ "^docs/.*" ], + linkToRepo ? false, }: stdenvNoCC.mkDerivation { @@ -90,7 +91,11 @@ stdenvNoCC.mkDerivation { in { name = relPath file; - url = "https://git.shellgod.icu/Sk7Str1p3/nixos/src/branch/main/${relPath file}"; + url = + if linkToRepo then + "https://git.shellgod.icu/Sk7Str1p3/nixos/src/branch/main/${relPath file}" + else + "file://${decl}"; } ) opt.declarations; };