From 0f028a075a1fe4554ad41426b2786400c0277db3 Mon Sep 17 00:00:00 2001 From: Adrian Gunnar Lauterer Date: Sun, 8 Dec 2024 13:07:44 +0100 Subject: [PATCH] ai stuff (like open webui (ollama ui)) some cleanup --- machines/galadriel/configuration.nix | 1 - profiles/ai.nix | 2 +- services/gate.nix | 44 ---------------------------- services/mc.nix | 20 ------------- services/ollamaWebui.nix | 17 +++++++++++ services/stableDiffusion.nix | 15 ---------- 6 files changed, 18 insertions(+), 81 deletions(-) delete mode 100644 services/gate.nix delete mode 100644 services/mc.nix create mode 100644 services/ollamaWebui.nix delete mode 100644 services/stableDiffusion.nix diff --git a/machines/galadriel/configuration.nix b/machines/galadriel/configuration.nix index 7095732..8aff6d8 100644 --- a/machines/galadriel/configuration.nix +++ b/machines/galadriel/configuration.nix @@ -21,7 +21,6 @@ ../../services/smb.nix ../../services/wordpress.nix ../../services/torrent.nix - ../../services/mc.nix #../../services/ozai.nix #../../services/stableDiffusion.nix ../../services/rss.nix diff --git a/profiles/ai.nix b/profiles/ai.nix index 712d3a1..7ee8f4a 100644 --- a/profiles/ai.nix +++ b/profiles/ai.nix @@ -5,7 +5,7 @@ ./base.nix ../services/podman.nix ../services/ollama.nix - # ../services/ollama-webui.nix + ../services/ollamaWebui.nix # ../services/whisper.nix ]; diff --git a/services/gate.nix b/services/gate.nix deleted file mode 100644 index 235be1f..0000000 --- a/services/gate.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ config, lib, pkgs, ... }: -let - mcPort = 25565; - configurationFile = '' - config: - lite: - enabled: true - routes: - - host: mc.256.no - backend: 100.84.215.84:25565 - ''; - file = pkgs.writeText "gate.yaml" configurationFile; -in -{ - - networking.firewall.allowedTCPPorts = [ mcPort]; - networking.firewall.allowedUDPPorts = [ mcPort]; - - users.users.gate = { - isSystemUser = true; - description = "Gate Minecraft Proxy User"; - home = "/var/lib/gate"; - createHome = true; - group = "gate"; - }; - - users.groups.gate = { - }; - - systemd.services."gate" = { - after = [ "network.target" ]; - wants = [ "network.target" ]; - wantedBy = [ "multi-user.target" ]; - - serviceConfig = { - ExecStart = "${pkgs.gate}/bin/gate -c ${file}"; - User = "gate"; - Group = "gate"; - Restart = "on-failure"; - ProtectKernelModules = true; - NoNewPrivileges = true; - }; - }; -} diff --git a/services/mc.nix b/services/mc.nix deleted file mode 100644 index 427de2d..0000000 --- a/services/mc.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ config, pkgs, lib, ... }: -{ - - services.minecraft-server = { - enable = true; - eula = true; - #jvmOpts = "-Xms4092M -Xmx4092M -XX:+UseG1GC -XX:+CMSIncrementalPacing -XX:+CMSClassUnloadingEnabled -XX:ParallelGCThreads=2 -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10"; - - -# serverProperties = { -# server-port = 25500; -# difficulty = 3; -# gamemode = 1; -# max-players = 8; -# motd = "Adrian Minecraft server!"; -# }; - openFirewall = true; - - }; -} diff --git a/services/ollamaWebui.nix b/services/ollamaWebui.nix new file mode 100644 index 0000000..92571bb --- /dev/null +++ b/services/ollamaWebui.nix @@ -0,0 +1,17 @@ +{ config, pkgs, lib, ... }: +{ + environment.systemPackages = [ + pkgs.unstable.open-webui + ]; + + + services.open-webui = { + enable = true; + + package = pkgs.unstable.open-webui; + port = 11111; + host = "0.0.0.0"; + openFirewall = true; + + }; +} diff --git a/services/stableDiffusion.nix b/services/stableDiffusion.nix deleted file mode 100644 index a665a21..0000000 --- a/services/stableDiffusion.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ config, pkgs, lib, ... }: -{ - imports = [ - ./podman.nix - ]; - environment.systemPackages = [ - ]; - virtualisation.oci-containers.containers."stableDiffusion" = { - #cmd = ["invokeai-web" "--host" "0.0.0.0"]; - ports = ["9090:9090" "9000:80" ]; - #enviroment = { }; - #image = "invokeai/invokeai"; - image = "goolashe/automatic1111-sd-webui"; - }; -}