From 5fd936b729eb5e0b23255c223b12f69b141db5ff Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Thu, 14 Dec 2023 17:08:41 +0100 Subject: [PATCH 1/5] fix: typo --- docs/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/default.nix b/docs/default.nix index e3b15ec..24210af 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -38,7 +38,7 @@ lib.mapAttrs' ( name: value: lib.nameValuePair - (builtins.head (lib.plitString "." name)) # take foo.options and turn it into just foo + (builtins.head (lib.splitString "." name)) # take foo.options and turn it into just foo (pkgs.nixosOptionsDoc { options = From d1af029a1dc9dcce891dd26b3a1dd8aa3c5a12c8 Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Mon, 18 Dec 2023 19:27:02 +0100 Subject: [PATCH 2/5] docs: add `networkNumbers`' description --- modules/globals/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/globals/default.nix b/modules/globals/default.nix index b28ea12..3c70df0 100644 --- a/modules/globals/default.nix +++ b/modules/globals/default.nix @@ -35,6 +35,9 @@ in sanchonet = 4; private = 42; }; + description = '' + Cardano network numbers + ''; internal = true; }; }; From d262cd781d166a7618ccfeaa3d35254534f714aa Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Mon, 18 Dec 2023 19:27:18 +0100 Subject: [PATCH 3/5] fix: correctly escape `$` --- modules/globals/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/globals/default.nix b/modules/globals/default.nix index 3c70df0..3f411ec 100644 --- a/modules/globals/default.nix +++ b/modules/globals/default.nix @@ -20,7 +20,7 @@ in networkNumber = lib.mkOption { type = types.int; default = cfg.networkNumbers.${cfg.network}; - defaultText = lib.literalExpression "config.cardanoNix.globals.networkNumbers.$${config.cardanoNix.globals.net}"; + defaultText = lib.literalExpression "config.cardanoNix.globals.networkNumbers.\${config.cardanoNix.globals.net}"; description = '' Cardano network number to join/use (should match cardanoNix.globals,network) ''; From 20e68e82478f5dd89768dcd9591dd61d4d34cab7 Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Mon, 18 Dec 2023 19:28:17 +0100 Subject: [PATCH 4/5] docs: show internal options --- docs/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/default.nix b/docs/default.nix index 24210af..63b3b38 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -41,6 +41,19 @@ (builtins.head (lib.splitString "." name)) # take foo.options and turn it into just foo (pkgs.nixosOptionsDoc { + # By default `nixosOptionsDoc` will ignore internal options but we want to show them + # This hack will make all the options not internal and visible and optionally append to the + # description a new field which is then corrected rendered as it was a native field + transformOptions = opt: + opt + // { + internal = false; + visible = true; + description = '' + ${lib.traceVal opt.description} + ${lib.optionalString opt.internal "*Internal:* true"} + ''; + }; options = (lib.evalModules { modules = (import "${inputs.nixpkgs}/nixos/modules/module-list.nix") ++ [value]; From d311821a8b3d03a72003de47b1b247a688d9ac56 Mon Sep 17 00:00:00 2001 From: Andrea Ciceri Date: Mon, 18 Dec 2023 19:34:48 +0100 Subject: [PATCH 5/5] style: format --- docs/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/default.nix b/docs/default.nix index 63b3b38..b596384 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -41,9 +41,9 @@ (builtins.head (lib.splitString "." name)) # take foo.options and turn it into just foo (pkgs.nixosOptionsDoc { - # By default `nixosOptionsDoc` will ignore internal options but we want to show them - # This hack will make all the options not internal and visible and optionally append to the - # description a new field which is then corrected rendered as it was a native field + # By default `nixosOptionsDoc` will ignore internal options but we want to show them + # This hack will make all the options not internal and visible and optionally append to the + # description a new field which is then corrected rendered as it was a native field transformOptions = opt: opt // {