41 lines
1.2 KiB
Nix
Raw Normal View History

{ config, pkgs, ... }:
2023-03-23 01:58:10 +03:00
let
backend = "podman";
2023-03-23 01:58:10 +03:00
nas-path = "/media/nas/media-stack";
volume = "local-nfs";
nfs-share = "10.10.10.11:/";
2023-03-23 01:58:10 +03:00
in {
2022-04-04 14:53:16 +03:00
virtualisation.oci-containers.containers.qbittorrent = {
autoStart = true;
2025-02-16 22:21:26 +03:00
# Tags: 5.0.3, version-5.0.3-r0, 5.0.3-r0-ls380
image = "docker.io/linuxserver/qbittorrent@sha256:308d768672fb9e86e800a73504c439176aabe5977bcdf8b99f7561bb603d9b6e";
2022-04-04 14:53:16 +03:00
environment = {
2023-03-23 01:58:10 +03:00
PUID = "1000";
PGID = "100";
2022-04-04 14:53:16 +03:00
UMASK = "002";
TZ = "Europe/Moscow";
2024-11-18 03:15:51 +03:00
TORRENTING_PORT = "7000";
DOCKER_MODS = "ghcr.io/gabe565/linuxserver-mod-vuetorrent";
2022-04-04 14:53:16 +03:00
};
2023-03-23 01:58:10 +03:00
extraOptions = [ "--pod=media-stack" ];
2022-04-04 14:53:16 +03:00
volumes = [
2023-03-23 01:58:10 +03:00
"${nas-path}/configs/qbittorrent:/config"
"${nas-path}:/data"
"${volume}:/nfs"
2022-04-04 14:53:16 +03:00
];
};
systemd.services."podman-create-volume-${volume}" = let
start = pkgs.writeShellScript "create-volume-${volume}" ''
podman volume exists ${volume} || podman volume create --opt type=nfs4 --opt o=rw --opt device=${nfs-share} ${volume}
'';
in rec {
path = [ config.virtualisation.podman.package ];
before = [ "${backend}-qbittorrent.service" ];
requiredBy = before;
serviceConfig = {
Type = "oneshot";
ExecStart = start;
};
};
2022-04-04 14:53:16 +03:00
}