WIP: Arr services, container ok, missing webpage
This commit is contained in:
parent
93e9d585cb
commit
5f6f6ad094
1 changed files with 113 additions and 2 deletions
|
|
@ -1,14 +1,125 @@
|
|||
{ config, lib, ... }:
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.download-pod;
|
||||
in
|
||||
{
|
||||
options.download-pod = {
|
||||
enable = lib.mkEnableOption "Enable the download searcher stack";
|
||||
|
||||
proxy = {
|
||||
enable = lib.mkEnableOption "Enable proxy for the services";
|
||||
|
||||
hostName = lib.mkOption {
|
||||
default = "example.com";
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
Top level hostname
|
||||
'';
|
||||
};
|
||||
|
||||
serverName = lib.mkOption {
|
||||
default = "localhost";
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
Server name where Caddy is
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
nixfiles.oci-containers.pods.download = { };
|
||||
|
||||
podman.enable = true;
|
||||
|
||||
systemd.services.pod-download = {
|
||||
description = "Start podman 'download' pod";
|
||||
wants = [ "network-online.target" ];
|
||||
after = [ "network-online.target" ];
|
||||
requiredBy = [
|
||||
"podman-jackett.service"
|
||||
"podman-radarr.service"
|
||||
"podman-sabnzbd.service"
|
||||
"podman-sonarr.service"
|
||||
];
|
||||
unitConfig = {
|
||||
RequiresMountsFor = "/run/containers";
|
||||
};
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
# - 9117: Jackett
|
||||
# - 7878: Radarr
|
||||
# - 8080: Sabnzbd
|
||||
# - 8989: Sonarr
|
||||
ExecStart = "-${pkgs.podman}/bin/podman pod create -p 9117:9117 -p 7878:7878 -p 8080:8080 -p 8989:8989 download";
|
||||
};
|
||||
path = [ pkgs.podman ];
|
||||
};
|
||||
|
||||
virtualisation.oci-containers.containers = {
|
||||
jackett = {
|
||||
image = "linuxserver/jackett";
|
||||
autoStart = true;
|
||||
user = "1000:100";
|
||||
extraOptions = [
|
||||
"--pod=download"
|
||||
];
|
||||
volumes = [ "jackett_config:/config" "jackett_data:/data" ];
|
||||
};
|
||||
|
||||
radarr = {
|
||||
image = "linuxserver/radarr";
|
||||
autoStart = true;
|
||||
user = "1000:100";
|
||||
extraOptions = [
|
||||
"--pod=download"
|
||||
];
|
||||
volumes = [ "radarr_config:/config" "radarr_data:/data" ];
|
||||
};
|
||||
|
||||
sabnzbd = {
|
||||
image = "linuxserver/sabnzbd";
|
||||
autoStart = true;
|
||||
user = "1000:100";
|
||||
extraOptions = [
|
||||
"--pod=download"
|
||||
];
|
||||
volumes = [ "sabnzbd_config:/config" "sabnzbd_data:/data" ];
|
||||
};
|
||||
|
||||
sonarr = {
|
||||
image = "linuxserver/sonarr";
|
||||
autoStart = true;
|
||||
user = "1000:100";
|
||||
extraOptions = [
|
||||
"--pod=download"
|
||||
];
|
||||
volumes = [ "sonarr_config:/config" "sonarr_data:/data" ];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
services.caddy = lib.mkIf cfg.proxy.enable {
|
||||
enable = true;
|
||||
enableReload = false;
|
||||
virtualHosts = {
|
||||
"jackett.${cfg.proxy.hostName}".extraConfig = ''
|
||||
reverse_proxy http://${cfg.proxy.serverName}:9117
|
||||
'';
|
||||
"radarr.${cfg.proxy.hostName}".extraConfig = ''
|
||||
reverse_proxy http://${cfg.proxy.serverName}:7878
|
||||
'';
|
||||
"sabnzbd.${cfg.proxy.hostName}".extraConfig = ''
|
||||
reverse_proxy http://${cfg.proxy.serverName}:8080
|
||||
'';
|
||||
"sonarr.${cfg.proxy.hostName}".extraConfig = ''
|
||||
reverse_proxy http://${cfg.proxy.serverName}:8989
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue