mirror of
https://gitlab.com/TECHNOFAB/nixlets.git
synced 2026-02-02 03:05:09 +01:00
docs(README): update README for the new format, add better examples
[skip ci]
This commit is contained in:
parent
eb1fd4cdd2
commit
2b60f365eb
1 changed files with 44 additions and 4 deletions
48
README.md
48
README.md
|
|
@ -1,10 +1,50 @@
|
||||||
# Nixlets
|
# Nixlets
|
||||||
|
|
||||||
This repository contains utilities for creating Nixlets and a collection of Nixlets. \
|
This repository contains utilities for creating Nixlets and a collection of Nixlets. \
|
||||||
Nixlets are kinda like Helm Charts but they are defined using Kubenix and the Nix language. \
|
Nixlets are kinda like Helm Charts, but they are defined using Kubenix and the Nix language. \
|
||||||
\
|
\
|
||||||
One can import the Flake and use the renderNixlet function to turn values (like in Helm) into Kubernetes manifests in YAML.
|
One can load Nixlets either via Nix Flakes or by fetching a tarball
|
||||||
|
|
||||||
## Examples
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
### Creating Nixlets
|
||||||
|
Nixlets need a `default.nix` and a `values.nix` (a `nixlet.nix` containing the metadata is also recommended). \
|
||||||
Check out the existing [nixlets](./nixlets/) to understand how they work. \
|
Check out the existing [nixlets](./nixlets/) to understand how they work. \
|
||||||
There is also a bare bones [template](./template/).
|
There is also a bare-bones [template](./template/).
|
||||||
|
|
||||||
|
### Using/rendering Nixlets
|
||||||
|
To render nixlets you only need to import the nixlets-lib:
|
||||||
|
```nix
|
||||||
|
{
|
||||||
|
inputs.nixlet-lib.url = "gitlab:TECHNOFAB/nixlets?dir=lib";
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Nixlets stored in the Gitlab Package Registry
|
||||||
|
```nix
|
||||||
|
(nixlet-lib.fetchNixletFromGitlab {
|
||||||
|
project = "TECHNOFAB/nixlets";
|
||||||
|
name = "<nixlet>";
|
||||||
|
version = "<version>";
|
||||||
|
sha256 = "<sha>";
|
||||||
|
}).render {
|
||||||
|
inherit system;
|
||||||
|
# values = {};
|
||||||
|
# project = "";
|
||||||
|
# overrides = ({...}: {});
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Nixlets fetchable from arbitrary URLs
|
||||||
|
```nix
|
||||||
|
(nixlet-lib.fetchNixlet "<URL>" "<sha>").render {
|
||||||
|
# ...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Metadata
|
||||||
|
Metadata of the Nixlets can also easily be accessed if needed:
|
||||||
|
```nix
|
||||||
|
(<some nixlet>).description # version, name, etc.
|
||||||
|
```
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue