Templates/default: move clan configuration into its own file
Doing this with the idea in mind, that flake-parts / default should define the same clan in clan.nix We can add a CI check to ensure both are the same files They got desynced in the past and describe completely different clans now
This commit is contained in:
@@ -1,2 +0,0 @@
|
||||
# DO NOT DELETE
|
||||
# This file is used by the clan cli to discover a clan flake
|
||||
45
templates/clan/default/clan.nix
Normal file
45
templates/clan/default/clan.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
# Ensure this is unique among all clans you want to use.
|
||||
meta.name = "__CHANGE_ME__";
|
||||
|
||||
# Docs: See https://docs.clan.lol/reference/clanServices
|
||||
inventory.instances = {
|
||||
|
||||
# Docs: https://docs.clan.lol/reference/clanServices/admin/
|
||||
# Admin service for managing machines
|
||||
# This service adds a root password and SSH access.
|
||||
admin = {
|
||||
roles.default.tags.all = { };
|
||||
roles.default.settings.allowedKeys = {
|
||||
# Insert the public key that you want to use for SSH access.
|
||||
# All keys will have ssh access to all machines ("tags.all" means 'all machines').
|
||||
# Alternatively set 'users.users.root.openssh.authorizedKeys.keys' in each machine
|
||||
"admin-machine-1" = "__YOUR_PUBLIC_KEY__";
|
||||
};
|
||||
};
|
||||
|
||||
# Docs: https://docs.clan.lol/reference/clanServices/zerotier/
|
||||
# The lines below will define a zerotier network and add all machines as 'peer' to it.
|
||||
# !!! Manual steps required:
|
||||
# - Define a controller machine for the zerotier network.
|
||||
# - Deploy the controller machine first to initilize the network.
|
||||
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."__YOUR_CONTROLLER__" = { };
|
||||
# Peers of the network
|
||||
# tags.all means 'all machines' will joined
|
||||
roles.peer.tags.all = { };
|
||||
};
|
||||
};
|
||||
|
||||
# Additional NixOS configuration can be added here.
|
||||
# machines/machine1/configuration.nix will be automatically imported.
|
||||
# See: https://docs.clan.lol/guides/more-machines/#automatic-registration
|
||||
machines = {
|
||||
# machine1 = { config, ... }: {
|
||||
# environment.systemPackages = [ pkgs.asciinema ];
|
||||
# };
|
||||
};
|
||||
}
|
||||
@@ -8,21 +8,7 @@
|
||||
# Usage see: https://docs.clan.lol
|
||||
clan = clan-core.lib.clan {
|
||||
inherit self;
|
||||
# Ensure this is unique among all clans you want to use.
|
||||
meta.name = "__CHANGE_ME__";
|
||||
|
||||
# All machines in ./machines will be imported.
|
||||
|
||||
# Prerequisite: boot into the installer.
|
||||
# See: https://docs.clan.lol/guides/getting-started/installer
|
||||
# local> mkdir -p ./machines/machine1
|
||||
# local> Edit ./machines/<machine>/configuration.nix to your liking.
|
||||
machines = {
|
||||
# You can also specify additional machines here.
|
||||
# somemachine = {
|
||||
# imports = [ ./some-machine/configuration.nix ];
|
||||
# }
|
||||
};
|
||||
imports = [ ./clan.nix ];
|
||||
};
|
||||
in
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user