explicit add zerotier

This commit is contained in:
Ingolf Wagner 2024-06-26 01:25:55 +02:00
parent 97f0797a57
commit 6cd432662b
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B

View file

@ -190,36 +190,44 @@
imports = modules ++ defaultModules ++ [ imports = modules ++ defaultModules ++ [
./machines/${name}/configuration.nix ./machines/${name}/configuration.nix
# clan core configuration
({ pkgs, lib, ... }: {
imports = [
# this magically adds all my machines in the zero tier network
# and makes the controller accept them.
# will automatic look into `/machines/<name>/facts/zerotier-ip
inputs.clan-core.clanModules.zerotier-static-peers
{
environment.systemPackages = [
(pkgs.writers.writeBashBin "zerotier-script-nodeid" ''
sudo ${pkgs.zerotierone}/bin/zerotier-cli info | cut -d " " -f 3
'')
];
}
# Statically configure the host names of machines based on their respective zerotier-ip.
inputs.clan-core.clanModules.static-hosts
# generate ssh host keys with facts
inputs.clan-core.clanModules.sshd
];
clan.static-hosts.topLevelDomain = "bear";
environment.systemPackages = [
clan-core.packages.${pkgs.system}.clan-cli
];
})
]; ];
}; };
zerotierControllerModule =
{
clan.networking.zerotier.controller = {
enable = true;
public = false;
};
};
zerotierModules = { pkgs, ... }: {
imports = [
# this magically adds all my machines in the zero tier network
# and makes the controller accept them.
# will automatic look into `/machines/<name>/facts/zerotier-ip
inputs.clan-core.clanModules.zerotier-static-peers
# Statically configure the host names of machines based on their respective zerotier-ip.
inputs.clan-core.clanModules.static-hosts
# generate ssh host keys with facts
inputs.clan-core.clanModules.sshd
# manual configs
{
clan.static-hosts.topLevelDomain = "bear";
environment.systemPackages = [
clan-core.packages.${pkgs.system}.clan-cli
(pkgs.writers.writeBashBin "zerotier-script-nodeid" ''
sudo ${pkgs.zerotierone}/bin/zerotier-cli info | cut -d " " -f 3
'')
];
}
];
};
defaultModules = [ defaultModules = [
# make flake inputs accessiable in NixOS # make flake inputs accessiable in NixOS
{ {
@ -360,6 +368,7 @@
name = "cream"; name = "cream";
host = "cream.bear"; host = "cream.bear";
modules = [ modules = [
zerotierModules
nixos-hardware.nixosModules.framework-12th-gen-intel nixos-hardware.nixosModules.framework-12th-gen-intel
retiolum.nixosModules.retiolum retiolum.nixosModules.retiolum
private_assets.nixosModules.cream private_assets.nixosModules.cream
@ -381,6 +390,7 @@
name = "cherry"; name = "cherry";
host = "cherry.bear"; host = "cherry.bear";
modules = [ modules = [
zerotierModules
nixos-hardware.nixosModules.framework-13th-gen-intel nixos-hardware.nixosModules.framework-13th-gen-intel
retiolum.nixosModules.retiolum retiolum.nixosModules.retiolum
private_assets.nixosModules.yubikey private_assets.nixosModules.yubikey
@ -401,12 +411,8 @@
name = "chungus"; name = "chungus";
host = "chungus.bear"; host = "chungus.bear";
modules = [ modules = [
{ zerotierModules
clan.networking.zerotier.controller = { zerotierControllerModule
enable = true;
public = false;
};
}
homeManagerModules homeManagerModules
stylixModules stylixModules
retiolum.nixosModules.retiolum retiolum.nixosModules.retiolum
@ -426,6 +432,7 @@
host = "orbi.bear"; host = "orbi.bear";
#host = "95.216.66.212"; #host = "95.216.66.212";
modules = [ modules = [
zerotierModules
homeManagerModules homeManagerModules
stylixModules stylixModules
srvos.nixosModules.hardware-hetzner-online-intel srvos.nixosModules.hardware-hetzner-online-intel