Files
kawa/modules/kawa-physical.nix
Debian b8d5b01b3a Fix Tailscale: separate systemd service for mesh connection
Problem: extraUpFlags in services.tailscale blocks boot if network
is not ready or Headscale is unreachable.

Solution:
- services.tailscale.enable = true (installs tailscale)
- Separate kawa-mesh-connect systemd service:
  - Waits for network-online.target
  - Waits for tailscaled.service
  - Connects to mesh after boot

Commands to verify:
  systemctl status tailscaled
  systemctl status kawa-mesh-connect
  tailscale status
2026-03-14 23:09:36 +00:00

81 lines
1.8 KiB
Nix

# KAWA Physical - Configuration pour machine physique CPU
# Usage: imports = [ ./modules/kawa-physical.nix ];
{ pkgs, ... }:
{
# Hostname FIXE (pas de lecture /sys - mode pur)
networking.hostName = "kawa-honor-v4";
# === TAILSCALE - Installation de base ===
services.tailscale = {
enable = true;
package = pkgs.tailscale;
};
# Service systemd pour connexion au mesh APRÈS le boot
systemd.services.kawa-mesh-connect = {
description = "KAWA Mesh Auto-Connect";
after = [ "network-online.target" "tailscaled.service" ];
wants = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
ExecStart = "${pkgs.tailscale}/bin/tailscale up --login-server=https://headscale.du-senegal.com --authkey=f43f36ef159b3df799eb316b81bdac1b415c7cc2add174d0 --force-reauth";
};
};
# OLLAMA CPU UNIQUEMENT
services.ollama = {
enable = true;
acceleration = null;
host = "0.0.0.0";
port = 11434;
};
# SSH
services.openssh = {
enable = true;
settings = {
PermitRootLogin = "yes";
PasswordAuthentication = true;
};
};
# NATS
services.nats = {
enable = true;
settings = {
port = 4222;
http_port = 8222;
};
};
# Syncthing
services.syncthing = {
enable = true;
user = "kawa";
group = "kawa";
};
# Utilisateur
users.users.kawa = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "tailscale" ];
initialPassword = "kawa2026";
};
# Firewall
networking.firewall = {
allowedTCPPorts = [ 22 11434 4222 22000 ];
allowedUDPPorts = [ 41641 22000 ];
trustedInterfaces = [ "tailscale0" ];
};
# Packages
environment.systemPackages = with pkgs; [
git vim tailscale ollama nats-cli curl wget htop
];
}