Skip to content

Add services

Summary

Add networking and SSH access so devices can reach each other.

Requirements

  • A Clan with at least one machine and user

Configure a ZeroTier Network

Add the configuration for a ZeroTier Network to your clan.nix file as follows:

clan.nix
{
  inventory.machines = {
    server = { };
    laptop = { };
  };

  inventory.instances = {
    zerotier = {
      # Replace with the name (string) of your machine that you will use as zerotier-controller
      # See: https://docs.zerotier.com/controller/
      # Deploy this machine first to create the network secrets
      roles.controller.machines."server" = { };
      # All clan machines will be peers of the network
      roles.peer.tags.all = { };
    };
  };
}

See services/official for all available services and how to configure them.

Or read guides/services if you want to bring your own!

Adding SSH keys is one of the most recommended services:

clan.nix
{
    inventory.machines = {
        server = { };
        laptop = { };
    };
    inventory.instances = {
        sshd = {
            roles.server.tags.all = { };
            roles.server.settings.authorizedKeys = {
                "root" = "ssh-ed25519 AAAAC3N…";
            };
        };

        user-root = {
            module = {
                name = "users";
                input = "clan-core";
            };
            roles.default.tags.all = { };
            roles.default.settings = {
                user = "root";
                prompt = true;
            };
        };
    };
}

The sshd service will add your SSH key for remote access to all machines. The user-root service will generate a root password for convenient administration.

This method is equivalent to directly setting authorizedKeys like in configuring a machine

Checkpoint

Under Construction

We are working on a feasible solution to test your progress up to this point. Unfortunately, there are currently no checkpoints available.

Up Next

We will deploy your configuration to either a bare metal physical device or a virtual device.

Please select your path accordingly:

Next Step: Prepare Physical Machines

Next Step: Prepare Virtual Machines

You can have a mix of both if you like. In that case, simply follow the respective guide per device type.