summaryrefslogtreecommitdiff
path: root/os/kay/modules
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2025-05-09 13:37:49 +0530
committersinanmohd <sinan@sinanmohd.com>2025-05-09 22:04:58 +0530
commit7029201a1444d2e538ededc6762d5d81f14c7ad3 (patch)
tree056a1dd1419903a98facde60a78dd4436554acec /os/kay/modules
parent7e36e8160d2985ffb90f2198c755208cd598cd75 (diff)
os/kay/alina: initHEADmaster
Diffstat (limited to 'os/kay/modules')
-rw-r--r--os/kay/modules/alina.nix24
-rw-r--r--os/kay/modules/www.nix25
2 files changed, 49 insertions, 0 deletions
diff --git a/os/kay/modules/alina.nix b/os/kay/modules/alina.nix
new file mode 100644
index 0000000..ef6331b
--- /dev/null
+++ b/os/kay/modules/alina.nix
@@ -0,0 +1,24 @@
+{ config, pkgs, ... }: let
+ domain = "alinafs.com";
+in {
+ sops.secrets."misc/alina" = {};
+
+ services.postgresql = {
+ ensureDatabases = [ "alina" ];
+ ensureUsers = [{
+ name = "alina";
+ ensureDBOwnership = true;
+ }];
+ };
+
+ services.alina = {
+ enable = true;
+ port = 8006;
+ environmentFile = config.sops.secrets."misc/alina".path;
+ settings.server = {
+ data = "/hdd/alina";
+ file_size_limit = 1024 * 1024 * 1024; /* 1GB */
+ public_url = "https://${domain}";
+ };
+ };
+}
diff --git a/os/kay/modules/www.nix b/os/kay/modules/www.nix
index 3903396..39e5b4b 100644
--- a/os/kay/modules/www.nix
+++ b/os/kay/modules/www.nix
@@ -226,6 +226,31 @@ in
}";
};
};
+
+
+ "www.alinafs.com" = defaultOpts // {
+ useACMEHost = null;
+ enableACME = true;
+ globalRedirect = "alinafs.com/home";
+ };
+ "alinafs.com" = defaultOpts // {
+ useACMEHost = null;
+ enableACME = true;
+
+ locations = {
+ "/metrics".return = "307 /home/";
+ "/" = {
+ proxyWebsockets = true;
+ proxyPass = "http://127.0.0.1:${builtins.toString config.services.alina.port}";
+ };
+ };
+
+ extraConfig = ''
+ proxy_buffering off;
+ proxy_request_buffering off;
+ client_max_body_size 0;
+ '';
+ };
};
};
}