add exposed lib to usage manual

This commit is contained in:
ibizaman 2025-06-04 03:16:44 +02:00 committed by Pierre Penninckx
parent 60c618e7cc
commit 3cc1c870ab
2 changed files with 26 additions and 2 deletions

View file

@ -1850,6 +1850,9 @@
"usage-example-nixosrebuild": [
"usage.html#usage-example-nixosrebuild"
],
"usage-lib": [
"usage.html#usage-lib"
],
"usage-flake": [
"usage.html#usage-flake"
],

View file

@ -75,8 +75,29 @@ the [GitHub repository][1] for Self Host Blocks updates the `nixpkgs` input ever
and verifies all tests pass before automatically merging the new `nixpkgs` version.
The setup is explained in [this blog post][2].
[1]: https://github.com/ibizaman/selfhostblocks
[2]: https://blog.tiserbox.com/posts/2023-12-25-automated-flake-lock-update-pull-requests-and-merging.html
[repo]: https://github.com/ibizaman/selfhostblocks
[automerge]: https://blog.tiserbox.com/posts/2023-12-25-automated-flake-lock-update-pull-requests-and-merging.html
### Use SelfHostBlocks' lib {#usage-lib}
Access any functions exposed by the [lib][] with this snippet:
```nix
{
inputs = {
selfhostblocks.url = "github:ibizaman/selfhostblocks";
};
outputs = { selfhostblocks, ... }:
let
shblib = selfhostblocks.lib.${system};
in
{
// Use shblib.replaceSecrets for example.
}
}
```
[lib]: https://github.com/ibizaman/selfhostblocks/blob/main/lib/default.nix
## Example Deployment with Nixos-Rebuild {#usage-example-nixosrebuild}