docs: add service update instructions
This commit is contained in:
@@ -17,19 +17,8 @@ To learn more: [Guide about clanService](../clanServices.md)
|
|||||||
|
|
||||||
## Configure a Zerotier Network (recommended)
|
## Configure a Zerotier Network (recommended)
|
||||||
|
|
||||||
```{.nix title="flake.nix" hl_lines="20-28"}
|
```{.nix title="clan.nix" hl_lines="12-20"}
|
||||||
{
|
{
|
||||||
inputs.clan-core.url = "https://git.clan.lol/clan/clan-core/archive/main.tar.gz";
|
|
||||||
inputs.nixpkgs.follows = "clan-core/nixpkgs";
|
|
||||||
inputs.flake-parts.follows = "clan-core/flake-parts";
|
|
||||||
inputs.flake-parts.inputs.nixpkgs-lib.follows = "clan-core/nixpkgs";
|
|
||||||
|
|
||||||
outputs =
|
|
||||||
inputs@{ flake-parts, ... }:
|
|
||||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
|
||||||
imports = [ inputs.clan-core.flakeModules.default ];
|
|
||||||
# Sometimes this attribute set is defined in clan.nix
|
|
||||||
clan = {
|
|
||||||
inventory.machines = {
|
inventory.machines = {
|
||||||
jon = {
|
jon = {
|
||||||
targetHost = "root@jon";
|
targetHost = "root@jon";
|
||||||
@@ -38,47 +27,36 @@ To learn more: [Guide about clanService](../clanServices.md)
|
|||||||
targetHost = "root@jon";
|
targetHost = "root@jon";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
inventory.instances = {
|
inventory.instances = {
|
||||||
zerotier = { # (1)
|
zerotier = { # (1)
|
||||||
# Defines 'jon' as the controller
|
# Replace with the name (string) of your machine that you will use as zerotier-controller
|
||||||
roles.controller.machines.jon = {};
|
# See: https://docs.zerotier.com/controller/
|
||||||
# Defines all machines as networking peer.
|
# Deploy this machine first to create the network secrets
|
||||||
# The 'all' tag is a clan builtin.
|
roles.controller.machines."jon" = { }; # (2)
|
||||||
roles.peer.tags.all = {};
|
# Peers of the network
|
||||||
|
# this line means 'all' clan machines will be 'peers'
|
||||||
|
roles.peer.tags.all = { }; # (3)
|
||||||
};
|
};
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
systems = [
|
|
||||||
"x86_64-linux"
|
|
||||||
"aarch64-linux"
|
|
||||||
"x86_64-darwin"
|
|
||||||
"aarch64-darwin"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
# ...
|
||||||
|
# elided
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
1. See [reference/clanServices](../../reference/clanServices/index.md) for all available services and how to configure them.
|
1. See [reference/clanServices](../../reference/clanServices/index.md) for all available services and how to configure them.
|
||||||
Or read [authoring/clanServices](../authoring/clanServices/index.md) if you want to bring your own
|
Or read [authoring/clanServices](../authoring/clanServices/index.md) if you want to bring your own
|
||||||
|
|
||||||
|
2. Replace `__YOUR_CONTROLLER_` with the *name* of your machine.
|
||||||
|
|
||||||
|
3. This line will add all machines of your clan as `peer` to zerotier
|
||||||
|
|
||||||
## Adding more recommended defaults
|
## Adding more recommended defaults
|
||||||
|
|
||||||
Adding the following services is recommended for most users:
|
Adding the following services is recommended for most users:
|
||||||
|
|
||||||
```{.nix title="flake.nix" hl_lines="25-35"}
|
```{.nix title="clan.nix" hl_lines="11-26"}
|
||||||
{
|
{
|
||||||
inputs.clan-core.url = "https://git.clan.lol/clan/clan-core/archive/main.tar.gz";
|
|
||||||
inputs.nixpkgs.follows = "clan-core/nixpkgs";
|
|
||||||
inputs.flake-parts.follows = "clan-core/flake-parts";
|
|
||||||
inputs.flake-parts.inputs.nixpkgs-lib.follows = "clan-core/nixpkgs";
|
|
||||||
|
|
||||||
outputs =
|
|
||||||
inputs@{ flake-parts, ... }:
|
|
||||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
|
||||||
imports = [ inputs.clan-core.flakeModules.default ];
|
|
||||||
# Sometimes this attribute set is defined in clan.nix
|
|
||||||
clan = {
|
|
||||||
inventory.machines = {
|
inventory.machines = {
|
||||||
jon = {
|
jon = {
|
||||||
targetHost = "root@jon";
|
targetHost = "root@jon";
|
||||||
@@ -88,10 +66,6 @@ Adding the following services is recommended for most users:
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
inventory.instances = {
|
inventory.instances = {
|
||||||
zerotier = {
|
|
||||||
roles.controller.machines.jon = {};
|
|
||||||
roles.peer.tags.all = {};
|
|
||||||
};
|
|
||||||
admin = { # (1)
|
admin = { # (1)
|
||||||
roles.default.tags.all = { };
|
roles.default.tags.all = { };
|
||||||
roles.default.settings = {
|
roles.default.settings = {
|
||||||
@@ -100,21 +74,20 @@ Adding the following services is recommended for most users:
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
state-version = { # (2)
|
jon-user = { # (2)
|
||||||
|
module.name = "users";
|
||||||
|
|
||||||
roles.default.tags.all = { };
|
roles.default.tags.all = { };
|
||||||
|
roles.default.settings = {
|
||||||
|
user = "jon"; # (3)
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
# ...
|
||||||
systems = [
|
# elided
|
||||||
"x86_64-linux"
|
|
||||||
"aarch64-linux"
|
|
||||||
"x86_64-darwin"
|
|
||||||
"aarch64-darwin"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
1. The `admin` service will generate a **root-password** and **add your ssh-key** that allows for convienient administration.
|
1. The `admin` service will generate a **root-password** and **add your ssh-key** that allows for convienient administration.
|
||||||
|
2. Adds `jon` as a user on all machines. Will create a `home` directory, and prompt for a password before deployment.
|
||||||
2. The `state-version` service will generate a [nixos state version](https://wiki.nixos.org/wiki/FAQ/When_do_I_update_stateVersion) for each system once it is deployed.
|
|
||||||
|
|||||||
Reference in New Issue
Block a user