1
1
mirror of https://github.com/divnix/digga.git synced 2024-12-23 16:11:51 +03:00
digga/jobs/default.nix
2022-02-23 15:23:14 -08:00

66 lines
1.9 KiB
Nix

{ system ? builtins.currentSystem
, inputs ? import ../ufr-polyfills/flake.lock.nix ./.
}:
let
nixpkgs = inputs.nixpkgs;
digga = inputs.digga;
pkgs = import nixpkgs { inherit system; config = { }; overlays = [ ]; };
docOptions = (digga.lib.mkFlake { self = { }; inputs = { }; }).options;
evaledOptions = (pkgs.lib.evalModules { modules = [ docOptions ]; }).options;
mkDocPartMd = part: title: intro:
pkgs.writeText "api-reference-${part}.md" ''
# ${title}
${intro}
${(
pkgs.nixosOptionsDoc { options = evaledOptions.${part}; }
).optionsMDDoc}
'';
in
{
mkApiReferenceTopLevel = pkgs.writeText "api-reference.md" ''
# Top Level API
`digga`'s top level api. API Containers are documented in their respective subchapter:
- [Channels](./api-reference-channels.md)
- [Home](./api-reference-home.md)
- [Devshell](./api-reference-devshell.md)
- [Nixos](./api-reference-nixos.md)
${( pkgs.nixosOptionsDoc {
options = {
inherit (evaledOptions)
channelsConfig
self
inputs
outputsBuilder
supportedSystems
;
};
}).optionsMDDoc}
'';
mkApiReferenceChannels = mkDocPartMd "channels" "Channels API Container" ''
Configure your channels that you can use throughout your configurations.
> #### Gotcha
> Devshell & Home-Manager `pkgs` instances are rendered off the
> `nixos.hostDefaults.channelName` (default) channel.
'';
mkApiReferenceDevshell = mkDocPartMd "devshell" "Devshell API Container" ''
Configure your devshell module collections of your environment.
'';
mkApiReferenceHome = mkDocPartMd "home" "Home-Manager API Container" ''
Configure your home manager modules, profiles & suites.
'';
mkApiReferenceNixos = mkDocPartMd "nixos" "NixOS API Container" ''
Configure your nixos modules, profiles & suites.
'';
}