Skip to content

Commit ffff49e

Browse files
committed
feat: working hosting stuff
1 parent 1211959 commit ffff49e

3 files changed

Lines changed: 68 additions & 8 deletions

File tree

custom_modules/core_services.nix

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ in
6161

6262
# even more OP ssh between all the devices
6363
services.tailscale = {
64-
# package = nixpkgs-stable.legacyPackages.${system}.tailscale;
6564
enable = true;
6665
};
6766

@@ -85,20 +84,80 @@ in
8584
extraConfig = ''
8685
bind 127.0.0.1
8786
88-
route /navidrome* {
87+
redir /navidrome /navidrome/
88+
handle /navidrome* {
8989
reverse_proxy 127.0.0.1:4533
9090
}
91+
9192
handle_path /netdata* {
9293
reverse_proxy 127.0.0.1:19999
9394
}
94-
handle_path /open-webui* {
95-
reverse_proxy 127.0.0.1:8085
95+
96+
handle {
97+
reverse_proxy 127.0.0.1:8082
9698
}
99+
97100
'';
98101
};
99102
};
103+
104+
services.caddy.virtualHosts."office-desktop.tail5ca7.ts.net:8444" = {
105+
extraConfig = ''
106+
reverse_proxy 127.0.0.1:8080
107+
'';
108+
};
100109
services.tailscale.permitCertUid = "caddy";
101110

111+
services.homepage-dashboard = {
112+
enable = true;
113+
openFirewall = true;
114+
listenPort = 8082; # The internal port (default is 8082 on NixOS)
115+
allowedHosts = "office-desktop.tail5ca7.ts.net";
116+
117+
# This defines the layout of your dashboard
118+
services = [
119+
{
120+
"My Services" = [
121+
{
122+
"Open WebUI" = {
123+
icon = "si-openai";
124+
href = "https://office-desktop.tail5ca7.ts.net:8444";
125+
description = "AI Chat Interface";
126+
};
127+
}
128+
{
129+
"Navidrome" = {
130+
icon = "navidrome";
131+
href = "/navidrome/";
132+
description = "Music Streamer";
133+
};
134+
}
135+
{
136+
"Netdata" = {
137+
icon = "netdata";
138+
href = "/netdata/";
139+
description = "System Monitoring";
140+
widget = {
141+
type = "netdata";
142+
url = "http://127.0.0.1:19999";
143+
};
144+
};
145+
}
146+
];
147+
}
148+
];
149+
150+
widgets = [
151+
{
152+
resources = {
153+
cpu = true;
154+
memory = true;
155+
disk = "/";
156+
};
157+
}
158+
];
159+
};
160+
102161
# create a oneshot job to authenticate to Tailscale
103162
# systemd.services.tailscale-autoconnect = {
104163
# description = "Automatic authentication to Tailscale";

custom_modules/workstation_services.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,17 +397,17 @@ in
397397
enable = true;
398398
# package = pkgs.ollama-cuda;
399399
# acceleration = "cuda";
400+
port = 11111;
401+
openFirewall = true;
400402
host = "0.0.0.0";
401403
# environmentVariables = {"OLLAMA_KV_CACHE_TYPE" = "q4_0"; };
402404
};
403405
services.open-webui = {
404-
# package = tmpnixpkgs.open-webui;
405406
openFirewall = true;
406407
enable = true;
407408
host = "0.0.0.0";
408409
environment = {
409-
OLLAMA_API_BASE_URL = "http://127.0.0.1:11434";
410-
# Disable authentication
410+
OLLAMA_API_BASE_URL = "http://127.0.0.1:11111";
411411
WEBUI_AUTH = "False";
412412
};
413413
};

flake.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@
173173
])
174174
];
175175
# GHC uses ld.gold which doesn't support pack-relative-relocs
176-
preConfigure = (args.preConfigure or "") + ''
176+
# Must run before compileBuildDriverPhase which compiles Setup.hs
177+
preCompileBuildDriver = (args.preCompileBuildDriver or "") + ''
177178
export NIX_CFLAGS_LINK="''${NIX_CFLAGS_LINK//-Wl,-z,pack-relative-relocs/}"
178179
'';
179180
}

0 commit comments

Comments
 (0)