mirror of
https://github.com/nix-community/plasma-manager.git
synced 2024-11-29 06:56:56 +03:00
6f1db348fc
Some checks failed
GitHub Pages Docs Generation / publish (ubuntu-latest) (push) Has been cancelled
62 lines
1.4 KiB
Nix
62 lines
1.4 KiB
Nix
{ pkgs, lib, ... }:
|
|
let
|
|
dontCheckModules = {
|
|
_module.check = false;
|
|
};
|
|
modules = [
|
|
../modules
|
|
dontCheckModules
|
|
];
|
|
|
|
githubDeclaration = user: repo: branch: subpath: {
|
|
url = "https://github.com/${user}/${repo}/blob/${branch}/${subpath}";
|
|
name = "<${repo}/${subpath}>";
|
|
};
|
|
|
|
pmPath = toString ./..;
|
|
transformOptions =
|
|
opt:
|
|
opt
|
|
// {
|
|
declarations = (
|
|
map (
|
|
decl:
|
|
if (lib.hasPrefix pmPath (toString decl)) then
|
|
(githubDeclaration "nix-community" "plasma-manager" "trunk" (
|
|
lib.removePrefix "/" (lib.removePrefix pmPath (toString decl))
|
|
))
|
|
else
|
|
decl
|
|
) opt.declarations
|
|
);
|
|
};
|
|
|
|
buildOptionsDocs = (
|
|
args@{ modules, ... }:
|
|
let
|
|
opts =
|
|
(lib.evalModules {
|
|
inherit modules;
|
|
class = "homeManager";
|
|
}).options;
|
|
options = builtins.removeAttrs opts [ "_module" ];
|
|
in
|
|
pkgs.buildPackages.nixosOptionsDoc {
|
|
inherit options;
|
|
inherit transformOptions;
|
|
warningsAreErrors = false;
|
|
}
|
|
);
|
|
|
|
pmOptionsDoc = buildOptionsDocs { inherit modules; };
|
|
plasma-manager-options = pkgs.callPackage ./plasma-manager-options.nix {
|
|
nixos-render-docs = pkgs.nixos-render-docs;
|
|
plasma-manager-options = pmOptionsDoc.optionsJSON;
|
|
revision = "latest";
|
|
};
|
|
in
|
|
{
|
|
html = plasma-manager-options;
|
|
json = pmOptionsDoc.optionsJSON;
|
|
}
|