diff --git a/flake.nix b/flake.nix index e30d0c3b0..61cddba25 100644 --- a/flake.nix +++ b/flake.nix @@ -108,8 +108,26 @@ pkgs = importNixpkgs system [rust-overlay.overlays.default]; treefmtEval = loadTreefmt pkgs; toplevel = name: config: nameValuePair "nixosConfigs/${name}" config.config.system.build.toplevel; + + dummy = import (nixpkgs + "/nixos/lib/eval-config.nix") { + inherit system; + modules = builtins.attrValues self.nixosModules ++ [ + { + networking = { + domain = "invalid"; + hostName = "options"; + }; + } + ]; + }; + options = builtins.mapAttrs (name: _: dummy.options.services.${name} or {}) self.nixosModules; in { - packages = importPackages pkgs; + packages = (importPackages pkgs) // { + options = pkgs.runCommand "options.json" { + build = (pkgs.nixosOptionsDoc { inherit options; }).optionsJSON; + } "cp $build/share/doc/nixos/options.json $out"; + }; + formatter = treefmtEval.config.build.wrapper; checks = mapAttrs' toplevel nixosConfigurations; }); diff --git a/modules/kbin.nix b/modules/kbin.nix index 215b1474c..e30241fc5 100644 --- a/modules/kbin.nix +++ b/modules/kbin.nix @@ -100,6 +100,7 @@ in { }; secrets = mkOption { + description = "Paths to files containing secrets, keyed by the respective environment variable."; type = submodule { freeformType = attrsOf (nullOr path); diff --git a/modules/pretalx.nix b/modules/pretalx.nix index 0d10ce56e..e167be0f0 100644 --- a/modules/pretalx.nix +++ b/modules/pretalx.nix @@ -14,6 +14,7 @@ inherit (lib) + literalExpression optionals modules types @@ -201,6 +202,7 @@ in { type = nullOr str; default = null; example = "pretalx"; + description = "Database user that pretalx should connect as."; }; passwordFile = mkOption {