templates: consistent templates, remove deprecated things
This commit is contained in:
2
templates/clan/flake-parts/.envrc
Normal file
2
templates/clan/flake-parts/.envrc
Normal file
@@ -0,0 +1,2 @@
|
||||
# shellcheck shell=bash
|
||||
use flake
|
||||
2
templates/clan/flake-parts/.gitignore
vendored
Normal file
2
templates/clan/flake-parts/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
result*
|
||||
.direnv/
|
||||
61
templates/clan/flake-parts/flake.nix
Normal file
61
templates/clan/flake-parts/flake.nix
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
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/flake-parts/
|
||||
clan = {
|
||||
# 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 ];
|
||||
};
|
||||
};
|
||||
};
|
||||
perSystem =
|
||||
{ pkgs, inputs', ... }:
|
||||
{
|
||||
devShells.default = pkgs.mkShell { packages = [ inputs'.clan-core.packages.clan-cli ]; };
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user