78 lines
2.5 KiB
Nix
78 lines
2.5 KiB
Nix
{
|
|
inputs.clan-core.url = "https://git.clan.lol/clan/clan-core/archive/main.tar.gz";
|
|
inputs.nixpkgs.follows = "clan-core/nixpkgs";
|
|
|
|
outputs =
|
|
{ self, clan-core, ... }:
|
|
let
|
|
# Usage see: https://docs.clan.lol
|
|
clan = clan-core.clanLib.buildClan {
|
|
inherit self;
|
|
|
|
# Ensure this is unique among all clans you want to use.
|
|
meta.name = "__CHANGE_ME__";
|
|
|
|
# Clan services to use. See https://docs.clan.lol/reference/clanServices
|
|
inventory.instances = {
|
|
admin = {
|
|
roles.default.tags.all = { };
|
|
roles.default.settings.allowedKeys = {
|
|
# Insert the public key of all your admin machines
|
|
# All these 'admin machines' will have ssh access to "tags.all" (all machines)
|
|
# Alternatively set 'users.users.root.openssh.authorizedKeys.keys' in each machine
|
|
"admin-machine-1" = "__YOUR_PUBLIC_KEY__";
|
|
};
|
|
};
|
|
|
|
zerotier = {
|
|
# Replace with the name 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 = { };
|
|
};
|
|
};
|
|
|
|
# A mapping of machine names to their nixos configuration.
|
|
# Allows specifying additional nixos configuration.
|
|
machines = {
|
|
somemachine =
|
|
{ pkgs, ... }:
|
|
{
|
|
environment.systemPackages = with pkgs; [ asciinema ];
|
|
};
|
|
};
|
|
};
|
|
in
|
|
{
|
|
|
|
# Expose clan structures as flake outputs. clanInternals is needed for
|
|
# the clan-cli. Exposing nixosConfigurations allows using `nixos-rebuild` as before.
|
|
inherit (clan)
|
|
nixosConfigurations
|
|
nixosModules
|
|
clanInternals
|
|
darwinConfigurations
|
|
darwinModules
|
|
;
|
|
|
|
# Add the Clan cli tool to the dev shell.
|
|
# Use "nix develop" to enter the dev shell.
|
|
devShells =
|
|
clan-core.inputs.nixpkgs.lib.genAttrs
|
|
[
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
"aarch64-darwin"
|
|
"x86_64-darwin"
|
|
]
|
|
(system: {
|
|
default = clan-core.inputs.nixpkgs.legacyPackages.${system}.mkShell {
|
|
packages = [ clan-core.packages.${system}.clan-cli ];
|
|
};
|
|
});
|
|
};
|
|
}
|