docs: rename all references from 'buildClan' to 'lib.clan'

This commit is contained in:
Johannes Kirschbauer
2025-06-27 09:54:23 +02:00
parent b34e5b30e5
commit d011b1ab02
17 changed files with 54 additions and 73 deletions

View File

@@ -52,7 +52,7 @@ clanModules/borgbackup
```nix title="flake.nix"
# ...
buildClan {
clan-core.lib.clan {
# 1. Add the module to the available clanModules with inventory support
inventory.modules = {
custom-module = ./modules/my_module;
@@ -175,7 +175,7 @@ The following shows how to add options to your module.
Configuration can be set as follows.
```nix title="flake.nix"
buildClan {
clan-core.lib.clan {
inventory.services = {
custom-module.instance_1 = {
roles.default.machines = [ "machineA" ];

View File

@@ -27,7 +27,7 @@ inputs = {
## 2. Import the Clan flake-parts Module
After updating your flake inputs, the next step is to import the Clan flake-parts module. This will make the [Clan options](../reference/nix-api/buildclan.md) available within `mkFlake`.
After updating your flake inputs, the next step is to import the Clan flake-parts module. This will make the [Clan options](../reference/nix-api/clan.md) available within `mkFlake`.
```nix
{
@@ -62,7 +62,7 @@ Next you'll need to configure Clan wide settings and define machines, here's an
];
# Define your Clan
# See: https://docs.clan.lol/reference/nix-api/buildclan/
# See: https://docs.clan.lol/reference/nix-api/clan/
clan = {
# Clan wide settings
meta.name = ""; # This is required and must be unique

View File

@@ -8,7 +8,7 @@ Clan currently offers the following methods to configure machines:
!!! Success "Recommended for advanced Nix users"
- flake.nix (i.e. via `buildClan`)
- flake.nix (i.e. via `clan-core.lib.clan`)
- `machine` argument
- `inventory` argument
@@ -30,7 +30,7 @@ In the `flake.nix` file:
=== "**normal flake template**"
```nix title="flake.nix" hl_lines="3"
buildClan {
clan-core.lib.clan {
# Set a unique name
meta.name = "Lobsters";
# Necessary for importing external Clan services
@@ -60,7 +60,7 @@ Adding or configuring a new machine requires two simple steps:
???+ Note "Cloud Machines"
NixOS can cause strange issues when booting in certain cloud environments.
- If on Linode: Make sure that the system uses Direct Disk boot kernel (found in the configuration pannel)
### Step 1. Identify Target Disk-ID

View File

@@ -175,7 +175,7 @@ During an update, the CLI will SSH into the build host and run `nixos-rebuild` f
```{.nix hl_lines="5" .no-copy}
buildClan {
clan {
# ...
machines = {
"jon" = {
@@ -191,7 +191,7 @@ To exclude machines from being updated when running `clan machines update` witho
one can set the `clan.deployment.requireExplicitUpdate` option to true:
```{.nix hl_lines="5" .no-copy}
buildClan {
clan {
# ...
machines = {
"jon" = {

View File

@@ -82,7 +82,7 @@ are loaded when using Clan:
outputs =
{ self, clan-core, ... }:
let
clan = clan-core.clanLib.buildClan {
clan = clan-core.clanLib.clan {
inherit self;
meta.name = "myclan";

View File

@@ -47,7 +47,7 @@ Each service can still be customized and configured according to the modules opt
See also: [Multiple Service Instances](#multiple-service-instances)
```{.nix hl_lines="6-7"}
buildClan {
clan-core.lib.clan {
inventory = {
services = {
borgbackup.instance_1 = {
@@ -69,7 +69,7 @@ It is possible to add services to multiple machines via tags as shown
!!! Example "Tags Example"
```{.nix hl_lines="5 8 14"}
buildClan {
clan-core.lib.clan {
inventory = {
machines = {
"jon" = {
@@ -101,7 +101,7 @@ It is possible to add services to multiple machines via tags as shown
In this example `backup_server` has role `client` and `server` in different instances.
```{.nix hl_lines="11 14"}
buildClan {
clan-core.lib.clan {
inventory = {
machines = {
"jon" = {};

View File

@@ -13,10 +13,10 @@ Currently, Clan supports the following features for macOS:
In this example, we'll name the machine `yourmachine`. Replace this with your preferred machine name.
=== "**If using core.lib.buildClan**"
=== "**If using clan-core.lib.clan**"
```nix
buildClan {
clan-core.lib.clan {
inventory = {
machines.yourmachine.machineClass = "darwin";
};

View File

@@ -68,7 +68,7 @@ output parameters.
The existing `nixosConfigurations` output of your flake will be created by
clan. In addition, a new `clanInternals` output will be added. Since both of
these are provided by the output of `lib.buildClan`, a common syntax is to use a
these are provided by the output of `clan-core.lib.clan`, a common syntax is to use a
`let...in` statement to create your clan and access it's parameters in the flake
outputs.
@@ -85,7 +85,7 @@ For the provide flake example, your flake should now look like this:
outputs = { self, nixpkgs, clan-core, ... }:
let
clan = clan-core.lib.buildClan {
clan = clan-core.lib.clan {
self = self; # this needs to point at the repository root
specialArgs = {};
meta.name = throw "Change me to something unique";

View File

@@ -17,19 +17,14 @@ Every folder `machines/{machineName}` will be registered automatically as a Clan
- [x] `machines/{machineName}/facter.json` Automatically configured, for further information see [nixos-facter](https://clan.lol/blog/nixos-facter/)
- [x] `machines/{machineName}/disko.nix` Automatically loaded, for further information see the [disko docs](https://github.com/nix-community/disko/blob/master/docs/quickstart.md).
## Manual declaration
Machines can also be added manually under `buildClan`, `clan.*` in flake-parts or via [`inventory`](../guides/inventory.md).
!!! Note
It is possible to use `inventory` and `buildClan` together at the same time.
Machines can be added via [`clan.inventory.machines`](../guides/inventory.md) or in `clan.machines`, which allows for defining NixOS options.
=== "**Individual Machine Configuration**"
```{.nix}
buildClan {
clan-core.lib.clan {
machines = {
"jon" = {
# Any valid nixos config
@@ -41,12 +36,13 @@ Machines can also be added manually under `buildClan`, `clan.*` in flake-parts o
=== "**Inventory Configuration**"
```{.nix}
buildClan {
clan-core.lib.clan {
inventory = {
machines = {
"jon" = {
# Inventory machines can set tags
# Inventory can set tags and other metadata
tags = [ "zone1" ];
deploy.targetHost = "root@jon";
};
};
};

View File

@@ -7,7 +7,7 @@ This section of the site provides an overview of available options and commands
- Learn how to use the [Clan CLI](./cli/index.md)
- Explore available services and application [modules](./clanModules/index.md)
- Discover [configuration options](./clan.core/index.md) that manage essential features
- Find descriptions of the [Nix interfaces](./nix-api/buildclan.md) for defining a Clan
- Find descriptions of the [Nix interfaces](./nix-api/clan.md) for defining a Clan
---