docs: add reference index pages
- add index pages for each reference documentation category - move concepts pages into the reference hierarchy - render clanModules overview page in the style of the CLI overview
This commit is contained in:
committed by
Johannes Kirschbauer
parent
27b4b1ed00
commit
b3fd59a802
8
docs/site/reference/index.md
Normal file
8
docs/site/reference/index.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# Documentation
|
||||
|
||||
This section of the site contains information about the following topics:
|
||||
|
||||
- How to use the [Clan CLI](./cli/index.md)
|
||||
- Available services and application [modules](./clanModules/index.md)
|
||||
- [Configuration options](./clan-core/index.md) controlling the essential features
|
||||
- Descriptions of the [Nix interfaces](./nix-api/index.md) for defining a Clan
|
||||
29
docs/site/reference/nix-api/buildclan.md
Normal file
29
docs/site/reference/nix-api/buildclan.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# buildClan
|
||||
|
||||
The core [function](https://git.clan.lol/clan/clan-core/src/branch/main/lib/build-clan/default.nix) that produces a Clan. It returns a set of consistent configurations for all machines with ready-to-use secrets, backups and other services.
|
||||
|
||||
## Inputs
|
||||
|
||||
`directory`
|
||||
: The directory containing the machines subdirectory
|
||||
|
||||
`machines`
|
||||
: Allows to include machine-specific modules i.e. machines.${name} = { ... }
|
||||
|
||||
`meta`
|
||||
: An optional set
|
||||
|
||||
: `{ name :: string, icon :: string, description :: string }`
|
||||
|
||||
`inventory`
|
||||
: Service set for easily configuring distributed services, such as backups
|
||||
|
||||
: For more details see [Inventory](./inventory.md)
|
||||
|
||||
`specialArgs`
|
||||
: Extra arguments to pass to nixosSystem i.e. useful to make self available
|
||||
|
||||
`pkgsForSystem`
|
||||
: A function that maps from architecture to pkgs, if specified this nixpkgs will be only imported once for each system.
|
||||
This improves performance, but all nipxkgs.* options will be ignored.
|
||||
`(string -> pkgs )`
|
||||
6
docs/site/reference/nix-api/index.md
Normal file
6
docs/site/reference/nix-api/index.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# Nix API Overview
|
||||
|
||||
There are two top-level components of the Nix API, which together allow for the declarative definition of a Clan:
|
||||
|
||||
- the [Inventory](./inventory.md), a structure representing the machines, services, custom configurations, and other data that constitute a Clan, and
|
||||
- the [`buildClan`](./buildclan.md) function, which constructs a Clan from an Inventory definition.
|
||||
57
docs/site/reference/nix-api/inventory.md
Normal file
57
docs/site/reference/nix-api/inventory.md
Normal file
@@ -0,0 +1,57 @@
|
||||
# Inventory
|
||||
|
||||
`Inventory` is an abstract service layer for consistently configuring distributed services across machine boundaries.
|
||||
|
||||
The following is the specification of the inventory in `cuelang`
|
||||
|
||||
```cue
|
||||
{
|
||||
meta: {
|
||||
// A name of the clan (primarily shown by the UI)
|
||||
name: string
|
||||
// A description of the clan
|
||||
description?: string
|
||||
// The icon path
|
||||
icon?: string
|
||||
}
|
||||
|
||||
// A map of services
|
||||
services: [string]: [string]: {
|
||||
// Required meta fields
|
||||
meta: {
|
||||
name: string,
|
||||
icon?: string
|
||||
description?: string,
|
||||
},
|
||||
// Machines are added via the avilable roles
|
||||
// Membership depends only on this field
|
||||
roles: [string]: {
|
||||
machines: [...string],
|
||||
tags: [...string],
|
||||
}
|
||||
machines?: {
|
||||
[string]: {
|
||||
config?: {
|
||||
...
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Global Configuration for the service
|
||||
// Applied to all machines.
|
||||
config?: {
|
||||
// Schema depends on the module.
|
||||
// It declares the interface how the service can be configured.
|
||||
...
|
||||
}
|
||||
}
|
||||
// A map of machines, extends the machines of `buildClan`
|
||||
machines: [string]: {
|
||||
name: string,
|
||||
description?: string,
|
||||
icon?: string
|
||||
tags: [...string]
|
||||
system: string
|
||||
}
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user