modules: move clan docs into clan-module

This commit is contained in:
Johannes Kirschbauer
2025-10-23 17:52:39 +02:00
parent 04b52d5bee
commit 1f8c2a3722
3 changed files with 27 additions and 23 deletions

View File

@@ -0,0 +1,23 @@
{
pkgs,
lib,
clanModule,
clanLib,
}:
let
eval = lib.evalModules {
modules = [
clanModule
];
};
evalDocs = pkgs.nixosOptionsDoc {
options = eval.options;
warningsAreErrors = false;
transformOptions = clanLib.docs.stripStorePathsFromDeclarations;
};
in
{
inherit (evalDocs) optionsJSON optionsNix;
inherit eval;
}

View File

@@ -1,4 +1,26 @@
{ self, lib, ... }:
let
clanModule = lib.modules.importApply ./default.nix { clan-core = self; };
in
{
flake.modules.clan.default = lib.modules.importApply ./default.nix { clan-core = self; };
flake.modules.clan.default = clanModule;
perSystem =
{
pkgs,
lib,
...
}:
let
jsonDocs = import ./eval-docs.nix {
inherit
pkgs
lib
clanModule
;
clanLib = self.clanLib;
};
in
{
legacyPackages.clan-options = jsonDocs.optionsJSON;
};
}