Skip to content

Commit

Permalink
pkgs/docs: fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
minijackson committed Nov 4, 2024
1 parent bd8c228 commit 6497499
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions pkgs/docs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,32 @@
iocOptions = documentation.options.iocOptions iocConfig;
nixosOptions = documentation.options.nixosOptions nixosConfig;

nixosOptionsAttrSet = (epnixLib.inputs.nixpkgs.lib.nixosSystem {
inherit (stdenvNoCC) system;
modules = [
epnixLib.inputs.self.nixosModules.nixos
];
}).options;
nixosOptionsAttrSet =
(epnixLib.inputs.nixpkgs.lib.nixosSystem {
inherit (stdenvNoCC) system;
modules = [
epnixLib.inputs.self.nixosModules.nixos
];
})
.options;

isOurs = option: lib.any (lib.hasPrefix "${epnixLib.inputs.self}") option.declarations;
isVisible = option: !option.internal;

relativePath = path: lib.pipe path [
(lib.splitString "/")
(lib.sublist 4 255)
(lib.concatStringsSep "/")
];
relativePath = path:
lib.pipe path [
(lib.splitString "/")
(lib.sublist 4 255)
(lib.concatStringsSep "/")
];

# rev = epnixLib.inputs.self.sourceInfo.rev or "master";

nixosOptionsSpec = lib.pipe nixosOptionsAttrSet [
nixdomainLib.optionAttrSetToDocList
(lib.filter isOurs)
(lib.filter isVisible)
(map (x: x // { declarations = map relativePath x.declarations; }))
(map (x: x // {declarations = map relativePath x.declarations;}))
(map (x: lib.nameValuePair x.name x))
lib.listToAttrs
builtins.toJSON
Expand Down

0 comments on commit 6497499

Please sign in to comment.