[other] show how to pin flake input to a tag (#364)

This commit is contained in:
Pierre Penninckx 2024-11-23 00:41:13 +01:00 committed by GitHub
parent b80c840743
commit 47d1db98df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 42 additions and 1 deletions

View file

@ -12,7 +12,13 @@ Template:
--> -->
# v0.2.2 (unreleased) # Upcoming Release
## Other Changes
- Show how to pin Self Host Blocks flake input to a tag.
# v0.2.2
## User Facing Backwards Compatible Changes ## User Facing Backwards Compatible Changes

View file

@ -36,6 +36,13 @@ To use it in your project, add the following flake input:
inputs.selfhostblocks.url = "github:ibizaman/selfhostblocks"; inputs.selfhostblocks.url = "github:ibizaman/selfhostblocks";
``` ```
Then, pin it to a release/tag with the following snippet.
Updating Self Host Blocks to a new version can be done the same way.
```nix
nix flake lock --override-input selfhostblocks github:ibizaman/selfhostblocks/v0.2.2
```
To get started using Self Host Blocks, To get started using Self Host Blocks,
follow [the usage section](https://shb.skarabox.com/usage.html) of the manual. follow [the usage section](https://shb.skarabox.com/usage.html) of the manual.
It goes over how to deploy with [Colmena][], [nixos-rebuild][] It goes over how to deploy with [Colmena][], [nixos-rebuild][]

View file

@ -1619,6 +1619,18 @@
"usage-flake": [ "usage-flake": [
"usage.html#usage-flake" "usage.html#usage-flake"
], ],
"usage-flake-autoupdate": [
"usage.html#usage-flake-autoupdate"
],
"usage-flake-nixpkgs": [
"usage.html#usage-flake-nixpkgs"
],
"usage-flake-substituter": [
"usage.html#usage-flake-substituter"
],
"usage-flake-tag": [
"usage.html#usage-flake-tag"
],
"usage-secrets": [ "usage-secrets": [
"usage.html#usage-secrets" "usage.html#usage-secrets"
] ]

View file

@ -16,6 +16,8 @@ imports = [
]; ];
``` ```
### Substituter {#usage-flake-substituter}
You can also use the public cache as a substituter with: You can also use the public cache as a substituter with:
```nix ```nix
@ -28,6 +30,8 @@ nix.settings.substituters = [
]; ];
``` ```
### Follow Nixpkgs {#usage-flake-nixpkgs}
Self Host Blocks provides its own `nixpkgs` input so both can be updated in lock step, ensuring Self Host Blocks provides its own `nixpkgs` input so both can be updated in lock step, ensuring
maximum compatibility. It is recommended to use the following `nixpkgs` as input for your maximum compatibility. It is recommended to use the following `nixpkgs` as input for your
deployments. Also, patches can be applied by Self Host Blocks. To handle all this, you need the deployments. Also, patches can be applied by Self Host Blocks. To handle all this, you need the
@ -52,6 +56,18 @@ in
Advanced users can if they wish use a version of `nixpkgs` of their choosing but then we cannot Advanced users can if they wish use a version of `nixpkgs` of their choosing but then we cannot
guarantee Self Host Block won't use a non-existing option from `nixpkgs`. guarantee Self Host Block won't use a non-existing option from `nixpkgs`.
### Tag Updates {#usage-flake-tag}
To pin Self Host Blocks to a release/tag, run the following snippet:
```nix
nix flake lock --override-input selfhostblocks github:ibizaman/selfhostblocks/v0.2.2
```
Updating Self Host Blocks to a new version can be done the same way.
### Auto Updates {#usage-flake-autoupdate}
To avoid manually updating the `nixpkgs` version, the [GitHub repository][1] for Self Host Blocks To avoid manually updating the `nixpkgs` version, the [GitHub repository][1] for Self Host Blocks
tries to update the `nixpkgs` input daily, verifying all tests pass before accepting this new tries to update the `nixpkgs` input daily, verifying all tests pass before accepting this new
`nixpkgs` version. The setup is explained in [this blog post][2]. `nixpkgs` version. The setup is explained in [this blog post][2].