1 { config, pkgs, lib, ... }:
5 let cfg = config.services.ombi;
10 enable = mkEnableOption (lib.mdDoc ''
12 Optionally see <https://docs.ombi.app/info/reverse-proxy>
13 on how to set up a reverse proxy
18 default = "/var/lib/ombi";
19 description = lib.mdDoc "The directory where Ombi stores its data files.";
25 description = lib.mdDoc "The port for the Ombi web interface.";
28 openFirewall = mkOption {
31 description = lib.mdDoc "Open ports in the firewall for the Ombi web interface.";
37 description = lib.mdDoc "User account under which Ombi runs.";
43 description = lib.mdDoc "Group under which Ombi runs.";
48 config = mkIf cfg.enable {
49 systemd.tmpfiles.rules = [
50 "d '${cfg.dataDir}' 0700 ${cfg.user} ${cfg.group} - -"
53 systemd.services.ombi = {
55 after = [ "network.target" ];
56 wantedBy = [ "multi-user.target" ];
62 ExecStart = "${pkgs.ombi}/bin/Ombi --storage '${cfg.dataDir}' --host 'http://*:${toString cfg.port}'";
63 Restart = "on-failure";
67 networking.firewall = mkIf cfg.openFirewall {
68 allowedTCPPorts = [ cfg.port ];
71 users.users = mkIf (cfg.user == "ombi") {
79 users.groups = mkIf (cfg.group == "ombi") { ombi = { }; };