Run formatter

This commit is contained in:
pinpox
2025-08-25 18:40:51 +02:00
parent a9c53b8b1e
commit 41c52197ea
71 changed files with 2118 additions and 1379 deletions

View File

@@ -1,66 +1,72 @@
# :material-clock-fast: Getting Started
Ready to manage your fleet of machines?
Ready to manage your fleet of machines?
We will create a declarative infrastructure using **clan**, **git**, and **nix flakes**.
We will create a declarative infrastructure using **clan**, **git**, and **nix
flakes**.
You'll finish with a centrally managed fleet, ready to import your existing NixOS configuration.
You'll finish with a centrally managed fleet, ready to import your existing
NixOS configuration.
## Prerequisites
Make sure you have the following:
* 💻 **Administration Machine**: Run the setup commands from this machine.
* 🛠️ **Nix**: The Nix package manager, installed on your administration machine.
- 💻 **Administration Machine**: Run the setup commands from this machine.
??? info "**How to install Nix (Linux / MacOS / NixOS)**"
- 🛠️ **Nix**: The Nix package manager, installed on your administration machine.
**On Linux or macOS:**
??? info "**How to install Nix (Linux / MacOS / NixOS)**"
1. Run the recommended installer:
```shellSession
curl --proto '=https' --tlsv1.2 -sSf -L [https://install.determinate.systems/nix](https://install.determinate.systems/nix) | sh -s -- install
```
````
**On Linux or macOS:**
2. After installation, ensure flakes are enabled by adding this line to `~/.config/nix/nix.conf`:
```
experimental-features = nix-command flakes
```
**On NixOS:**
Nix is already installed. You only need to enable flakes for your user in your `configuration.nix`:
```nix
{
nix.settings.experimental-features = [ "nix-command" "flakes" ];
}
1. Run the recommended installer:
```shellSession
curl --proto '=https' --tlsv1.2 -sSf -L [https://install.determinate.systems/nix](https://install.determinate.systems/nix) | sh -s -- install
```
Then, run `nixos-rebuild switch` to apply the changes.
* 🎯 **Target Machine(s)**: A remote machine with SSH, or your local machine (if NixOS).
2. After installation, ensure flakes are enabled by adding this line to `~/.config/nix/nix.conf`:
```
experimental-features = nix-command flakes
```
**On NixOS:**
Nix is already installed. You only need to enable flakes for your user in your `configuration.nix`:
```nix
{
nix.settings.experimental-features = [ "nix-command" "flakes" ];
}
```
Then, run `nixos-rebuild switch` to apply the changes.
````
- 🎯 **Target Machine(s)**: A remote machine with SSH, or your local machine (if
NixOS).
## Create a New Clan
1. Navigate to your desired directory:
```shellSession
cd <your-directory>
```
```shellSession
cd <your-directory>
```
2. Create a new clan flake:
**Note:** This creates a new directory in your current location
**Note:** This creates a new directory in your current location
```shellSession
nix run https://git.clan.lol/clan/clan-core/archive/main.tar.gz#clan-cli --refresh -- flakes create
```
```shellSession
nix run https://git.clan.lol/clan/clan-core/archive/main.tar.gz#clan-cli --refresh -- flakes create
```
3. Enter a **name** in the prompt:
```terminalSession
Enter a name for the new clan: my-clan
```
```terminalSession
Enter a name for the new clan: my-clan
```
## Project Structure
@@ -75,11 +81,11 @@ my-clan/
└── sops/
```
!!! note "Templates"
This is the structure for the `default` template.
Use `clan templates list` and `clan templates --help` for available templates & more. Keep in mind that the exact files may change as templates evolve.
!!! note "Templates" This is the structure for the `default` template.
```
Use `clan templates list` and `clan templates --help` for available templates & more. Keep in mind that the exact files may change as templates evolve.
```
## Activate the Environment
@@ -91,24 +97,29 @@ cd my-clan
Now, activate the environment using one of the following methods.
=== "Automatic (direnv, recommended)"
**Prerequisite**: You must have [nix-direnv](https://github.com/nix-community/nix-direnv) installed.
=== "Automatic (direnv, recommended)" **Prerequisite**: You must have
[nix-direnv](https://github.com/nix-community/nix-direnv) installed.
Run `direnv allow` to automatically load the environment whenever you enter this directory.
```shellSession
direnv allow
```
````
Run `direnv allow` to automatically load the environment whenever you enter this directory.
```shellSession
direnv allow
```
````
=== "Manual (nix develop)"
Run nix develop to load the environment for your current shell session.
=== "Manual (nix develop)" Run nix develop to load the environment for your
current shell session.
```shellSession
nix develop
```
````
```shellSession
nix develop
```
````
## Verify the Setup
Once your environment is active, verify that the clan command is available by running:
Once your environment is active, verify that the clan command is available by
running:
```shellSession
clan show
@@ -121,9 +132,10 @@ Name: __CHANGE_ME__
Description: None
```
This confirms your setup is working correctly.
This confirms your setup is working correctly.
You can now change the default name by editing the `meta.name` field in your `clan.nix` file.
You can now change the default name by editing the `meta.name` field in your
`clan.nix` file.
```{.nix title="clan.nix" hl_lines="3"}
{
@@ -134,4 +146,3 @@ You can now change the default name by editing the `meta.name` field in your `cl
# elided
}
```