diff --git a/hosts/NixOracle/configuration.nix b/hosts/NixOracle/configuration.nix index 88905e7..be57e3e 100644 --- a/hosts/NixOracle/configuration.nix +++ b/hosts/NixOracle/configuration.nix @@ -69,6 +69,7 @@ in { systemd.tmpfiles.rules = [ "d /home/${username}/notebooks 0750 ${username} users -" + "d /etc/nextcloud-secrets 0750 nextcloud nextcloud -" ]; environment.etc."jupyter/jupyter_server_config.py".text = '' @@ -95,6 +96,10 @@ in { forceSSL = true; root = "${site}"; }; + virtualHosts."nextcloud.tadix.dev" = { + enableACME = true; + forceSSL = true; + }; virtualHosts."git.tadix.dev" = { enableACME = true; forceSSL = true; @@ -107,6 +112,15 @@ in { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; ''; }; + locations."/api/" = { + proxyPass = "http://127.0.0.1:3000"; + extraConfig = '' + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + add_header 'Access-Control-Allow-Origin' 'https://tadix.dev' always; + ''; + }; }; virtualHosts."biolab.tadix.dev" = { enableACME = true; @@ -129,6 +143,63 @@ in { }; }; + services.nextcloud = { + enable = true; + package = pkgs.nextcloud32; + hostName = "nextcloud.tadix.dev"; + https = true; + database.createLocally = true; + config = { + adminuser = "ltadeu6"; + adminpassFile = "/etc/nextcloud-secrets/admin-password"; + dbtype = "pgsql"; + }; + phpOptions."opcache.interned_strings_buffer" = "16"; + settings = { + default_phone_region = "BR"; + maintenance_window_start = 1; + }; + }; + + systemd.services.nextcloud-minimize = { + description = "Configure Nextcloud for minimal file-storage use"; + after = [ "nextcloud-setup.service" ]; + requires = [ "nextcloud-setup.service" ]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + User = "nextcloud"; + Group = "nextcloud"; + }; + unitConfig.X-Restart-Triggers = [ + (builtins.toFile "nextcloud-minimize-trigger" '' + defaultapp=files + disabled=activity,calendar,contacts,dashboard,firstrunwizard,photos,weather_status,circles,recommendations,user_status,systemtags + theme=dark,#7aa2f7,plain + repair=mimetypes + '') + ]; + script = '' + set -eu + occ=/run/current-system/sw/bin/nextcloud-occ + + $occ config:system:set defaultapp --value=files + + for app in activity calendar contacts dashboard firstrunwizard photos weather_status circles recommendations user_status systemtags; do + $occ app:disable "$app" 2>/dev/null || true + done + + $occ config:app:set theming defaultColorScheme --value=dark + $occ config:app:set theming color --value="#7aa2f7" + $occ config:app:set theming background --value="plain" + $occ config:app:set theming name --value="Files" + $occ config:app:set theming slogan --value="" + + $occ maintenance:repair --include-expensive + ''; + }; + services.forgejo = { enable = true; database.type = "sqlite3"; @@ -141,6 +212,11 @@ in { }; service.DISABLE_REGISTRATION = true; log.LEVEL = "Warn"; + cors = { + ENABLED = true; + ALLOW_DOMAIN = "tadix.dev"; + METHODS = "GET,HEAD,OPTIONS"; + }; }; }; diff --git a/hosts/NixOracle/site/index.html b/hosts/NixOracle/site/index.html index 3e3df24..06834a1 100644 --- a/hosts/NixOracle/site/index.html +++ b/hosts/NixOracle/site/index.html @@ -23,10 +23,20 @@

PROJECTS

- BioLab - — bioprocess modeling and parameter estimation tool -
- source · live + BioLab + — web tool for kinetic parameter estimation from experimental growth data.
+ Fits seven microbial models simultaneously via PSO and ranks results by AIC.
+
live +

+

+ matrix-android + — minimal Android Matrix client with a terminal aesthetic.
+ Text-only, E2EE via libolm, SSO login.
+

+

+ nixos-config + — NixOS and Home Manager config for desktop and Oracle VPS.
+ Covers system services, secrets via agenix, Hyprland, and self-hosted infrastructure.

@@ -42,6 +52,8 @@ github git jupyter + nextcloud +