mount nfs share into qbittorrent container
This commit is contained in:
parent
d1898c1392
commit
35d6d350cc
@ -1,6 +1,9 @@
|
|||||||
{ ... }:
|
{ config, pkgs, ... }:
|
||||||
let
|
let
|
||||||
|
backend = "podman";
|
||||||
nas-path = "/media/nas/media-stack";
|
nas-path = "/media/nas/media-stack";
|
||||||
|
volume = "local-nfs";
|
||||||
|
nfs-share = "10.10.10.11:/";
|
||||||
in {
|
in {
|
||||||
virtualisation.oci-containers.containers.qbittorrent = {
|
virtualisation.oci-containers.containers.qbittorrent = {
|
||||||
autoStart = true;
|
autoStart = true;
|
||||||
@ -11,11 +14,27 @@ in {
|
|||||||
UMASK = "002";
|
UMASK = "002";
|
||||||
TZ = "Europe/Moscow";
|
TZ = "Europe/Moscow";
|
||||||
TORRENTING_PORT = "7000";
|
TORRENTING_PORT = "7000";
|
||||||
|
DOCKER_MODS = "ghcr.io/gabe565/linuxserver-mod-vuetorrent";
|
||||||
};
|
};
|
||||||
extraOptions = [ "--pod=media-stack" ];
|
extraOptions = [ "--pod=media-stack" ];
|
||||||
volumes = [
|
volumes = [
|
||||||
"${nas-path}/configs/qbittorrent:/config"
|
"${nas-path}/configs/qbittorrent:/config"
|
||||||
"${nas-path}:/data"
|
"${nas-path}:/data"
|
||||||
|
"${volume}:/nfs"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user