explicit add zerotier
This commit is contained in:
parent
97f0797a57
commit
6cd432662b
1 changed files with 40 additions and 33 deletions
73
flake.nix
73
flake.nix
|
@ -190,36 +190,44 @@
|
|||
|
||||
imports = modules ++ defaultModules ++ [
|
||||
./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 = [
|
||||
# make flake inputs accessiable in NixOS
|
||||
{
|
||||
|
@ -360,6 +368,7 @@
|
|||
name = "cream";
|
||||
host = "cream.bear";
|
||||
modules = [
|
||||
zerotierModules
|
||||
nixos-hardware.nixosModules.framework-12th-gen-intel
|
||||
retiolum.nixosModules.retiolum
|
||||
private_assets.nixosModules.cream
|
||||
|
@ -381,6 +390,7 @@
|
|||
name = "cherry";
|
||||
host = "cherry.bear";
|
||||
modules = [
|
||||
zerotierModules
|
||||
nixos-hardware.nixosModules.framework-13th-gen-intel
|
||||
retiolum.nixosModules.retiolum
|
||||
private_assets.nixosModules.yubikey
|
||||
|
@ -401,12 +411,8 @@
|
|||
name = "chungus";
|
||||
host = "chungus.bear";
|
||||
modules = [
|
||||
{
|
||||
clan.networking.zerotier.controller = {
|
||||
enable = true;
|
||||
public = false;
|
||||
};
|
||||
}
|
||||
zerotierModules
|
||||
zerotierControllerModule
|
||||
homeManagerModules
|
||||
stylixModules
|
||||
retiolum.nixosModules.retiolum
|
||||
|
@ -426,6 +432,7 @@
|
|||
host = "orbi.bear";
|
||||
#host = "95.216.66.212";
|
||||
modules = [
|
||||
zerotierModules
|
||||
homeManagerModules
|
||||
stylixModules
|
||||
srvos.nixosModules.hardware-hetzner-online-intel
|
||||
|
|
Loading…
Reference in a new issue