From 95a1f0f56149283693354e8109b30d27e527b411 Mon Sep 17 00:00:00 2001 From: Nathan Date: Sun, 6 Apr 2025 12:01:32 -0500 Subject: [PATCH] add rustdesk --- home-manager/nathan/packages/default.nix | 1 + .../configuration/homebox/default.nix | 1 + .../services/containers/rustdesk/default.nix | 56 +++++++++++++++++++ .../services/containers/traefik/default.nix | 12 ++++ 4 files changed, 70 insertions(+) create mode 100644 system-config/services/containers/rustdesk/default.nix diff --git a/home-manager/nathan/packages/default.nix b/home-manager/nathan/packages/default.nix index 05a4809..f88d608 100644 --- a/home-manager/nathan/packages/default.nix +++ b/home-manager/nathan/packages/default.nix @@ -78,6 +78,7 @@ #unfree { geogebra spotify + rustdesk #} brave diff --git a/system-config/configuration/homebox/default.nix b/system-config/configuration/homebox/default.nix index eddd675..63d3243 100644 --- a/system-config/configuration/homebox/default.nix +++ b/system-config/configuration/homebox/default.nix @@ -265,6 +265,7 @@ gitea.enable = true; homeassistant.enable = false; ntfy.enable = false; + rustdesk.enable = true; }; }; }; diff --git a/system-config/services/containers/rustdesk/default.nix b/system-config/services/containers/rustdesk/default.nix new file mode 100644 index 0000000..ca9e1ae --- /dev/null +++ b/system-config/services/containers/rustdesk/default.nix @@ -0,0 +1,56 @@ +{ config, lib, ... }: { + + options.sysconfig.opts.virtualization.rustdesk.enable = lib.options.mkOption { + type = lib.types.bool; + default = false; + }; + + config = lib.mkIf config.sysconfig.opts.virtualization.rustdesk.enable { + + + firewall.allowedTCPPorts = [ 21115 21116 21117 ]; + firewall.allowedUDPPorts = [ 21116 ]; + + containers.rustdesk = { + + autoStart = true; + privateNetwork = true; + hostAddress = "192.168.100.10"; + localAddress = "192.168.100.21"; + forwardPorts = [ + { + containerPort = 21115; + hostPort = 21115; + } + { + containerPort = 21116; + hostPort = 21116; + } + { + containerPort = 21117; + hostPort = 21117; + } + ]; + config = { + + services.rustdesk-server = { + enable = true; + + openFirewall = true; + + relay = { + enable = true; + #extraArgs = [ "" ]; + }; + + signal = { + enable = true; + relayHosts = [ "rustdesk.blunkall.us:21117" ]; + }; + }; + }; + + system.stateVersion = "24.05"; + }; + }; +} diff --git a/system-config/services/containers/traefik/default.nix b/system-config/services/containers/traefik/default.nix index ab878fb..1ce51d5 100644 --- a/system-config/services/containers/traefik/default.nix +++ b/system-config/services/containers/traefik/default.nix @@ -210,6 +210,13 @@ tls.certResolver = "cloudflare"; }; + rustdesk = { + entryPoints = [ "websecure" ]; + rule = "Host(`rustdesk.blunkall.us`)"; + service = "rustdesk-webclient"; + tls.certResolver = "cloudflare"; + }; + /*pihole = { entryPoints = [ "localsecure" ]; rule = "Host(`pihole.blunkall.us`)"; @@ -265,6 +272,11 @@ homeassistant.loadBalancer.servers = [ { url = "http://192.168.100.10:8123"; } ]; ollama.loadBalancer.servers = [ { url = "http://192.168.100.10:11434"; } ]; + + rustdesk-webclient.loadBalancer.servers = [ + { url = "http://192.168.100.21:21118"; } + { url = "http://192.168.100.21:21119"; } + ]; }; }; };