Skip to content

Commit baa146b

Browse files
authored
Merge pull request #17 from vancycles-knak/main
learned a few things + traefik works...nextcloud not
2 parents 88457e4 + ac52363 commit baa146b

1 file changed

Lines changed: 92 additions & 20 deletions

File tree

nix-darwin/flakes/monolith/configuration.nix

Lines changed: 92 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@
6464
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMCpHZBybBTCsCyW6/Q4OZ07SvUpRUvclc10u25j0B+Q hvandersleyen@gmail.com"
6565
];
6666
};
67-
67+
security.sudo.extraConfig = ''
68+
Defaults timestamp_timeout=3600
69+
'';
6870
environment.systemPackages = with pkgs; [
6971
sops
7072
git
@@ -137,8 +139,11 @@
137139
# scheme = "https";
138140
# };
139141
};
140-
# websecure = {
141-
# address = ":443";
142+
websecure = {
143+
address = ":443";
144+
};
145+
# log = {
146+
# level = "DEBUG";
142147
# };
143148
};
144149
};
@@ -150,7 +155,22 @@
150155
rule = "PathPrefix(`/n8n`)";
151156
service = "n8n-service";
152157
entryPoints = [ "web" ];
153-
# middlewares = [ "strip-n8n-prefix" ];
158+
middlewares = [ "strip-n8n-prefix" ];
159+
};
160+
161+
gitea-router = {
162+
rule = "PathPrefix(`/gitea`)";
163+
service = "gitea-service";
164+
entryPoints = [ "web" ];
165+
middlewares = [ "strip-gitea-prefix" ];
166+
};
167+
168+
nextcloud-router = {
169+
#rule = "Host(`nextcloud.local`)";
170+
rule = "PathPrefix(`/nextcloud`)";
171+
service = "nextcloud-service";
172+
entryPoints = [ "web" ];
173+
middlewares = [ "strip-nextcloud-prefix" ];
154174
};
155175
};
156176

@@ -160,25 +180,39 @@
160180
{ url = "http://0.0.0.0:5678"; }
161181
];
162182
};
183+
184+
gitea-service = {
185+
loadBalancer.servers = [
186+
{ url = "http://0.0.0.0:3000"; }
187+
];
188+
};
189+
190+
nextcloud-service = {
191+
loadBalancer.servers = [
192+
{ url = "http://0.0.0.0:8081"; }
193+
];
194+
};
195+
};
196+
middlewares = {
197+
strip-n8n-prefix = {
198+
stripPrefix.prefixes = [ "/n8n" ];
199+
};
200+
201+
strip-gitea-prefix = {
202+
stripPrefix.prefixes = [ "/gitea" ];
203+
};
204+
205+
strip-nextcloud-prefix = {
206+
stripPrefix.prefixes = [ "/nextcloud" ];
207+
};
163208
};
164-
# middlewares = {
165-
# strip-n8n-prefix = {
166-
# stripPrefix.prefixes = [ "/n8n" ];
167-
# };
168-
# };
169209
};
170210
};
171211
};
212+
172213
systemd.services.traefik.serviceConfig = {
173214
ReadWritePaths = [ "/var/lib/traefik" ];
174215
};
175-
services.paperless = {
176-
enable = true;
177-
};
178-
services.home-assistant = {
179-
enable = false;
180-
config = { };
181-
};
182216
services.n8n = {
183217
enable = true;
184218
openFirewall = true;
@@ -191,17 +225,54 @@
191225
systemd.services.n8n.environment = {
192226
N8N_SECURE_COOKIE = "false";
193227
N8N_LISTEN_ADDRESS = "0.0.0.0";
228+
N8N_PATH = "/n8n";
229+
};
230+
services.gitea = {
231+
enable = true;
232+
settings = {
233+
server.ROOT_URL = "http://0.0.0.0/gitea/";
234+
};
194235
};
236+
environment.etc."nextcloud-admin-pass".text = "thisisnotsecure";
195237
services.nextcloud = {
196238
enable = false;
197239
hostName = meta.hostname;
198-
# config.adminpassFile
240+
config = {
241+
adminpassFile = "/etc/nextcloud-admin-pass";
242+
dbtype = "sqlite";
243+
};
244+
settings = {
245+
trusted_domains = [ "192.168.4.129" ];
246+
};
247+
# phpOptions = {
248+
# "listen.port" = 8081;
249+
# };
250+
extraApps = {
251+
inherit (config.services.nextcloud.package.packages.apps)
252+
news
253+
contacts
254+
calendar
255+
tasks
256+
;
257+
};
258+
extraAppsEnable = true;
199259
};
200-
services.gitea = {
260+
services.paperless = {
201261
enable = true;
202262
};
263+
services.home-assistant = {
264+
enable = false;
265+
config = { };
266+
};
203267
# networking
204268
networking = {
269+
hosts = {
270+
"192.168.4.129" = [
271+
"nextcloud.local"
272+
"gitea.local"
273+
"n8n.local"
274+
];
275+
};
205276
defaultGateway = "192.168.4.1"; # Point to Proxmox
206277
nameservers = [ "192.168.1.1" ]; # Ensure DNS resolution
207278
hostName = meta.hostname; # Define your hostname.
@@ -211,8 +282,9 @@
211282
allowedUDPPorts = [ 34197 ]; # Explicitly open Factorio port
212283
allowedTCPPorts = [
213284
80
214-
5678 # n8n
215-
3000 # gitea
285+
# 8081
286+
# 5678 # n8n
287+
# 3000 # gitea
216288
27015
217289
];
218290
};

0 commit comments

Comments
 (0)