40 lines
1.1 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;
2024-11-18 03:15:51 +03:00
image = "docker.io/linuxserver/qbittorrent:5.0.1-r0-ls363";
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
}