diff --git a/docs/redirects.json b/docs/redirects.json index 8332ab7..7e7dd82 100644 --- a/docs/redirects.json +++ b/docs/redirects.json @@ -1850,6 +1850,9 @@ "usage-example-nixosrebuild": [ "usage.html#usage-example-nixosrebuild" ], + "usage-lib": [ + "usage.html#usage-lib" + ], "usage-flake": [ "usage.html#usage-flake" ], diff --git a/docs/usage.md b/docs/usage.md index 49577e9..99fa36d 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -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}