Add kawa-gpu.nix module for NVIDIA GPU machines
This commit is contained in:
69
modules/kawa-gpu.nix
Normal file
69
modules/kawa-gpu.nix
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
# KAWA GPU - Configuration pour machine avec GPU
|
||||||
|
# Usage: imports = [ ./modules/kawa-gpu.nix ];
|
||||||
|
|
||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Hostname (à personnaliser)
|
||||||
|
networking.hostName = "kawa-gpu-node";
|
||||||
|
|
||||||
|
# Activation de Tailscale
|
||||||
|
services.tailscale = {
|
||||||
|
enable = true;
|
||||||
|
extraUpFlags = [
|
||||||
|
"--login-server=https://headscale.du-senegal.com"
|
||||||
|
"--authkey=f43f36ef159b3df799eb316b81bdac1b415c7cc2add174d0"
|
||||||
|
"--force-reauth"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# CONFIGURATION OLLAMA GPU (NVIDIA)
|
||||||
|
services.ollama = {
|
||||||
|
enable = true;
|
||||||
|
acceleration = "cuda";
|
||||||
|
host = "0.0.0.0";
|
||||||
|
port = 11434;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Drivers NVIDIA
|
||||||
|
hardware.nvidia = {
|
||||||
|
modesetting.enable = true;
|
||||||
|
open = false;
|
||||||
|
nvidiaSettings = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# SSH
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
PermitRootLogin = "yes";
|
||||||
|
PasswordAuthentication = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# NATS Client
|
||||||
|
services.nats = {
|
||||||
|
enable = true;
|
||||||
|
server = "100.64.0.1:4222";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Firewall
|
||||||
|
networking.firewall = {
|
||||||
|
allowedTCPPorts = [ 22 11434 4222 22000 ];
|
||||||
|
allowedUDPPorts = [ 41641 22000 ];
|
||||||
|
trustedInterfaces = [ "tailscale0" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Packages système
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
git
|
||||||
|
vim
|
||||||
|
tailscale
|
||||||
|
ollama
|
||||||
|
nats-cli
|
||||||
|
curl
|
||||||
|
wget
|
||||||
|
htop
|
||||||
|
nvidia-settings
|
||||||
|
];
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user