mirror of
https://github.com/Death916/nixconfig.git
synced 2026-04-11 04:48:25 -07:00
76 lines
2 KiB
Nix
76 lines
2 KiB
Nix
# Auto-generated by compose2nix.
|
|
|
|
{ pkgs, lib, ... }:
|
|
|
|
{
|
|
# Runtime
|
|
virtualisation.docker = {
|
|
enable = true;
|
|
autoPrune.enable = true;
|
|
};
|
|
virtualisation.oci-containers.backend = "docker";
|
|
|
|
# Containers
|
|
virtualisation.oci-containers.containers."dispatcharr" = {
|
|
image = "ghcr.io/dispatcharr/dispatcharr:latest";
|
|
environment = {
|
|
"CELERY_BROKER_URL" = "redis://localhost:6379/0";
|
|
"DISPATCHARR_ENV" = "aio";
|
|
"DISPATCHARR_LOG_LEVEL" = "info";
|
|
"REDIS_HOST" = "localhost";
|
|
};
|
|
volumes = [
|
|
"/storage/services/dispatcharr:/data:rw"
|
|
];
|
|
ports = [
|
|
"9191:9191/tcp"
|
|
];
|
|
log-driver = "journald";
|
|
extraOptions = [
|
|
"--network-alias=dispatcharr"
|
|
"--network=dispatcharr_default"
|
|
];
|
|
};
|
|
systemd.services."docker-dispatcharr" = {
|
|
serviceConfig = {
|
|
Restart = lib.mkOverride 90 "no";
|
|
};
|
|
after = [
|
|
"docker-network-dispatcharr_default.service"
|
|
];
|
|
requires = [
|
|
"docker-network-dispatcharr_default.service"
|
|
];
|
|
partOf = [
|
|
"docker-compose-dispatcharr-root.target"
|
|
];
|
|
wantedBy = [
|
|
"docker-compose-dispatcharr-root.target"
|
|
];
|
|
};
|
|
|
|
# Networks
|
|
systemd.services."docker-network-dispatcharr_default" = {
|
|
path = [ pkgs.docker ];
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
RemainAfterExit = true;
|
|
ExecStop = "docker network rm -f dispatcharr_default";
|
|
};
|
|
script = ''
|
|
docker network inspect dispatcharr_default || docker network create dispatcharr_default
|
|
'';
|
|
partOf = [ "docker-compose-dispatcharr-root.target" ];
|
|
wantedBy = [ "docker-compose-dispatcharr-root.target" ];
|
|
};
|
|
|
|
# Root service
|
|
# When started, this will automatically create all resources and start
|
|
# the containers. When stopped, this will teardown all resources.
|
|
systemd.targets."docker-compose-dispatcharr-root" = {
|
|
unitConfig = {
|
|
Description = "Root target generated by compose2nix.";
|
|
};
|
|
wantedBy = [ "multi-user.target" ];
|
|
};
|
|
}
|