27 lines
652 B
Nix
27 lines
652 B
Nix
{ lib, pkgs, config, ... }:
|
|
with lib;
|
|
let cfg = config.nas-apps.sabnzbd;
|
|
in {
|
|
imports = [ ./options.nix ];
|
|
|
|
config = mkIf cfg.enable {
|
|
virtualisation.oci-containers.containers."${cfg.name}" = {
|
|
autoStart = cfg.autoStart;
|
|
image = cfg.image;
|
|
ports = [ "${cfg.port}:8080" ];
|
|
volumes = [
|
|
"${cfg.configPath}:/config"
|
|
"${cfg.moviesPath}:/movies"
|
|
"${cfg.tvPath}:/tv"
|
|
"${cfg.downloadsPath}:/downloads"
|
|
"${cfg.downloadsIncompletePath}:/downloads-incomplete"
|
|
];
|
|
environment = {
|
|
PUID = cfg.puid;
|
|
PGID = cfg.pgid;
|
|
TZ = cfg.timeZone;
|
|
};
|
|
};
|
|
};
|
|
}
|