nixos-config/modules/ombi.nix
2022-08-08 20:35:38 +02:00

61 lines
1.4 KiB
Nix

{ config, ... }:
let
cfg = config.services.ombi;
in
{
nixpkgs.config.packageOverrides = pkgs:
{
ombi = pkgs.callPackage ../packages/ombi {};
};
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: