Merge pull request 'docs: improve flake-parts reference' (#2187) from hsjobeki/clan-core:hsjobeki-roles-interface into main
This commit is contained in:
@@ -346,12 +346,42 @@ def produce_build_clan_docs() -> None:
|
||||
|
||||
output = """# BuildClan
|
||||
|
||||
This provides an overview of the available arguments of the `buildClan` function.
|
||||
This provides an overview of the available arguments of the `clan` interface.
|
||||
|
||||
!!! Note "Flake-parts"
|
||||
Each attribute is also available via `clan.<option>`
|
||||
Each attribute is documented below
|
||||
|
||||
For example `clan.inventory = ...;` is equivalent to `buildClan { inventory = ...; }`.
|
||||
- **buildClan**: A function that takes an attribute set.`.
|
||||
|
||||
??? example "buildClan Example"
|
||||
|
||||
```nix
|
||||
buildClan {
|
||||
directory = self;
|
||||
machines = {
|
||||
jon = { };
|
||||
sara = { };
|
||||
};
|
||||
};
|
||||
```
|
||||
|
||||
- **flake-parts**: Each attribute can be defined via `clan.<attribute name>`. See our [flake-parts](../../manual/flake-parts.md) guide.
|
||||
|
||||
??? example "flake-parts Example"
|
||||
|
||||
```nix
|
||||
flake-parts.lib.mkFlake { inherit inputs; } ({
|
||||
systems = [];
|
||||
imports = [
|
||||
clan-core.flakeModules.default
|
||||
];
|
||||
clan = {
|
||||
machines = {
|
||||
jon = { };
|
||||
sara = { };
|
||||
};
|
||||
};
|
||||
});
|
||||
```
|
||||
|
||||
"""
|
||||
with Path(BUILD_CLAN_PATH).open() as f:
|
||||
|
||||
@@ -28,7 +28,7 @@ inputs = {
|
||||
|
||||
## 2. Import Clan-Core Flake Module
|
||||
|
||||
After updating your flake inputs, the next step is to import the `clan-core` flake module. This will make the [clan options](https://git.clan.lol/clan/clan-core/src/branch/main/flakeModules/clan.nix) available within `mkFlake`.
|
||||
After updating your flake inputs, the next step is to import the `clan-core` flake module. This will make the [clan options](../reference/nix-api/buildclan.md) available within `mkFlake`.
|
||||
|
||||
```nix
|
||||
outputs =
|
||||
@@ -61,6 +61,7 @@ Below is a guide on how to structure this in your flake.nix:
|
||||
clan-core.flakeModules.default
|
||||
];
|
||||
# Define your clan
|
||||
# See: https://docs.clan.lol/reference/nix-api/buildclan/
|
||||
clan = {
|
||||
# Clan wide settings. (Required)
|
||||
meta.name = ""; # Ensure to choose a unique name.
|
||||
|
||||
Reference in New Issue
Block a user