From 67f0a4b1e5c8e16166c55335ce57bc4de51f01be Mon Sep 17 00:00:00 2001 From: mc-fucker Date: Tue, 29 Mar 2022 11:26:12 +0200 Subject: [PATCH] added ombi --- modules/ombi.nix | 52 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/modules/ombi.nix b/modules/ombi.nix index c87bfc0..cb47a69 100644 --- a/modules/ombi.nix +++ b/modules/ombi.nix @@ -1,4 +1,7 @@ -{ ... }: +{ config, ... }: +let + cfg = config.services.ombi; +in { nixpkgs.config.packageOverrides = pkgs: { @@ -6,6 +9,53 @@ }; services.ombi.enable = true; + + services.nginx.virtualHosts."ombi.mc-fucker.cool" = { + forceSSL = true; + enableACME = true; + locations = { + "/" = { + proxyPass = "http://localhost:5000"; + extraConfig = '' + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + ''; + }; + + "/api" = { + proxyPass = "http://localhost:5000"; + }; + + "/swagger" = { + proxyPass = "http://localhost:5000"; + }; + }; + + extraConfig = '' + ssl_session_cache builtin:1000; + gzip on; + gzip_vary on; + gzip_min_length 1000; + gzip_proxied any; + gzip_types text/plain text/css text/xml application/xml text/javascript application/x-javascript image/svg+xml; + gzip_disable "MSIE [1-6]\."; + ''; + }; + + systemd.services.ombi = + { + serviceConfig = { + ProtectSystem = "full"; + ProtectHostname = "true"; + ProtectClock = "true"; + #WorkingDirectory = cfg.dataDir; + #StateDirectory = "ombi"; + #RootDirectory = "/run/ombi"; + #RuntimeDirectory = "ombi"; + #BindReadOnlyPaths = builtins.storeDir; + }; + }; } # vim: set et ts=2 sw=2 ai: