refactor: format nix code with alejandra & rename nix files for clarity

This commit is contained in:
pengo 2026-06-08 17:38:35 -06:00
parent bb86ea12ca
commit df492dab6b
6 changed files with 298 additions and 311 deletions

View file

@ -1,20 +1,18 @@
self:
{
self: {
pkgs,
lib ? pkgs.lib,
module,
optionPrefix,
}:
let
}: let
# Absolute store path of the flake root, used to compute relative subpaths
repoPath = toString self;
eval = lib.evalModules {
modules = [
(import module self)
{ _module.check = false; }
{_module.check = false;}
];
specialArgs = { inherit pkgs; };
specialArgs = {inherit pkgs;};
};
# Relative path of the module file within the repo (e.g. "nix/hm-modules.nix")
@ -28,15 +26,14 @@ let
optionsDoc = pkgs.nixosOptionsDoc {
options = eval.options;
transformOptions =
opt:
transformOptions = opt:
opt
// {
visible = opt.visible && !opt.internal;
# Strip the option prefix so docs show "enable" instead of "programs.mango.enable"
name = lib.removePrefix optionPrefix opt.name;
declarations = [ moduleDeclaration ];
declarations = [moduleDeclaration];
};
};
in
optionsDoc.optionsJSON
optionsDoc.optionsJSON