-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtdarr-node.nix
executable file
·91 lines (82 loc) · 2.03 KB
/
tdarr-node.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{ config, ... }:
let
asiyahPorts = import ../hosts/asiyah/misc/service-ports.nix;
addresses = import ../misc/wireguard-addresses.nix;
userUid = 976;
groupGid = 972;
in
{
imports = [
./podman.nix
];
users.users.tdarr = {
isSystemUser = true;
linger = true;
home = "/var/lib/tdarr";
createHome = true;
uid = userUid;
homeMode = "775";
group = "tdarr";
extraGroups = [ "render" ];
};
users.groups.tdarr = {
gid = groupGid;
};
boot.kernelModules = [ "nfs" ];
fileSystems =
let
nfsOptions = [
"nfsvers=4.2"
"_netdev"
"noauto"
"x-systemd.automount"
"x-systemd.mount-timeout=10"
"x-systemd.idle-timeout=1min"
"timeo=14"
"nofail"
"noatime"
];
in
{
"/var/lib/tdarr" = {
device = "${addresses.gradientnet.asiyah}:/export/mediarr/tdarr/";
fsType = "nfs";
options = nfsOptions;
};
"/asiyahMedia" = {
device = "${addresses.gradientnet.asiyah}:/export/downloads/";
fsType = "nfs";
options = nfsOptions;
};
};
virtualisation.oci-containers.containers.tdarrNode = {
image = "ghcr.io/haveagitgat/tdarr_node:latest";
pull = "newer";
volumes = [
"/var/lib/tdarr/server:/app/server"
"/var/lib/tdarr/config:/app/configs"
"/var/lib/tdarr/logs:/app/logs"
"/var/lib/tdarr/temp:/temp"
"/asiyahMedia/tv:/media/tv"
"/asiyahMedia/movies:/media/movies"
"/asiyahMedia/adverts:/media/adverts"
];
environment = {
TZ = config.time.timeZone;
PUID = toString userUid;
PGID = toString groupGid;
serverIP = addresses.gradientnet.asiyah;
serverPort = toString asiyahPorts.tdarr-server;
ffmpegVersion = "6";
nodeName = config.networking.hostName;
};
extraOptions = [
"--network=host"
"--device=/dev/dri/:/dev/dri/"
];
};
systemd.services.podman-tdarrNode = {
after = [ "var-lib-tdarr.mount" "asiyahMedia.mount" ];
bindsTo = [ "var-lib-tdarr.mount" "asiyahMedia.mount" ];
};
}