templates: consistent templates, remove deprecated things
This commit is contained in:
2
templates/clan/default/.gitignore
vendored
Normal file
2
templates/clan/default/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
result*
|
||||
.direnv/
|
||||
@@ -1,53 +1,42 @@
|
||||
{
|
||||
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; } {
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"x86_64-darwin"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
imports = [ inputs.clan-core.flakeModules.default ];
|
||||
# https://docs.clan.lol/guides/getting-started/flake-parts/
|
||||
clan = {
|
||||
{ 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__";
|
||||
|
||||
# Information about your machines. Machines under ./machines will be auto-imported.
|
||||
inventory.machines = {
|
||||
somemachine.tags = [ "desktop" ];
|
||||
somemachine.deploy.targetHost = "root@somemachine";
|
||||
};
|
||||
|
||||
# Clan services to use. See https://docs.clan.lol/reference/clanServices
|
||||
inventory.instances = {
|
||||
|
||||
admin = {
|
||||
module = {
|
||||
name = "admin";
|
||||
input = "clan";
|
||||
};
|
||||
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 = {
|
||||
module = {
|
||||
name = "zerotier";
|
||||
input = "clan";
|
||||
};
|
||||
# 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 configuration.
|
||||
# A mapping of machine names to their nixos configuration.
|
||||
# Allows specifying additional nixos configuration.
|
||||
machines = {
|
||||
somemachine =
|
||||
{ pkgs, ... }:
|
||||
@@ -56,10 +45,33 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
perSystem =
|
||||
{ pkgs, inputs', ... }:
|
||||
{
|
||||
devShells.default = pkgs.mkShell { packages = [ inputs'.clan-core.packages.clan-cli ]; };
|
||||
};
|
||||
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 ];
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user