1
0
Fork 0
mirror of https://github.com/hercules-ci/flake-parts.git synced 2025-03-05 08:27:02 +00:00

Merge pull request #30 from hercules-ci/more-docs

More docs
This commit is contained in:
Robert Hensing 2022-05-29 18:46:10 +02:00 committed by GitHub
commit 7678eacc0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 3 deletions

6
dev/flake.lock generated
View file

@ -20,11 +20,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1653740649,
"narHash": "sha256-3kZc+D03J+Uleftpdv5BuBogwkc45zvhDte/AI0BvaI=",
"lastModified": 1653841712,
"narHash": "sha256-XBF4i1MuIRAEbFpj3Z3fVaYxzNEsYapyENtw3vG+q1I=",
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"rev": "6d99ef9727b1327ec7eb6fa2055b74bd88ea4709",
"rev": "e14d2131b7c81acca3904b584ac45fb72da64dd2",
"type": "github"
},
"original": {

View file

@ -7,6 +7,7 @@
eval = libNix.evalFlakeModule { self = { inputs = { inherit (inputs) nixpkgs; }; }; } {
imports = [
inputs.pre-commit-hooks-nix.flakeModule
inputs.hercules-ci-effects.flakeModule
];
};
opts = eval.options;
@ -72,6 +73,13 @@
baseUrl = "https://github.com/hercules-ci/pre-commit-hooks.nix/blob/flakeModule";
sourcePath = inputs.pre-commit-hooks-nix;
};
# TODO make this a dynamic input
hercules_ci_effectsOptions = optionsDoc {
title = "hercules-ci-effects";
sourceName = "hercules-ci-effects";
baseUrl = "https://github.com/hercules-ci/hercules-ci-effects/blob/master";
sourcePath = inputs.hercules-ci-effects;
};
# pandoc
htmlBefore = ''
<html>
@ -95,6 +103,7 @@
buildPhase = ''
( echo "$htmlBefore";
pandoc --verbose --from docbook --to html5 $coreOptions;
pandoc --verbose --from docbook --to html5 $hercules_ci_effectsOptions;
pandoc --verbose --from docbook --to html5 $pre_commit_hooks_nixOptions;
echo "$htmlAfter"; ) >options.html
'';

View file

@ -41,6 +41,24 @@
<a href="https://github.com/hercules-ci/flake-parts/blob/main/ChangeLog.md">ChangeLog</a>
</p>
<p>
Integrations:
</p>
<ul>
<li><code>github:hercules-ci/hercules-ci-effects</code></li>
<li><code>github:hercules-ci/pre-commit-hooks.nix/flakeModule</code></li>
</ul>
<h2>Write your own integration</h2>
<p>
For a general introduction to modules, you can read <a href="https://nixos.org/manual/nixos/stable/index.html#sec-writing-modules">Writing Modules</a> in the NixOS manual, though it goes into NixOS specifics quite quickly. Instead of <code>services.&ltname>.*</code>, etc, we have our own <a href="./options.html">options</a>.
</p>
<p>
Writing modules in a distributed ecosystem can be a bit different. If you're inclined to write to some other module's options, consider whether those will be loaded and whether your integration idea is always desirable. If it's not always desirable, consider splitting it off into an extra module, e.g. <code>flakeModules.someOther</code>. Otherwise check if it's loaded: <code>lib.optionalAttrs (options?some.other.option)</code>. You can ask <code>@roberth</code> on GitHub.
</p>
</body>
</html>