blob: 84f3ec012baafea094dc797ce1f5adec47afec70 (
plain)
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
|
{
containers.jellyfin = {
autoStart = true;
privateNetwork = true;
extraVeths.vb-jellyfin = {
hostBridge = "br-lan0";
#localMacAddress = "02:00:00:00:00:02"; # TODO update to 26.05
};
bindMounts = {
"/media" = {
hostPath = "/media/ingens/media";
isReadOnly = true;
};
};
# GPU
allowedDevices = [
{ node = "/dev/dri/card1"; modifier = "rw"; }
{ node = "/dev/dri/renderD128"; modifier = "rw"; }
];
bindMounts = {
"/dev/dri/card1" = {
hostPath = "/dev/dri/card1";
isReadOnly = false;
};
"/dev/dri/renderD128" = {
hostPath = "/dev/dri/renderD128";
isReadOnly = false;
};
};
config = { lib, config, ... }: {
# Network
networking.interfaces.vb-jellyfin.useDHCP = true;
networking.firewall.allowedTCPPorts = [ 80 ]; # Caddy
# CUDA
nix.settings = {
substituters = [ "https://cache.flox.dev" ];
trusted-public-keys = [ "flox-cache-public-1:7F4OyH7ZCnFhcze3fJdfyXYLQw/aV7GEed86nQ7IsOs=" ];
};
#nixpkgs.config.cudaSupport = true;
users.users.jellyfin.extraGroups = [ "video" "render" ];
# Jellyfin
services.jellyfin = {
enable = true;
openFirewall = true;
#hardwareAcceleration = {
# enable = true;
# type = "nvenc";
# device = "/dev/dri/renderD128";
#};
};
# Reverse proxy
services.caddy = {
enable = true;
virtualHosts.":80".extraConfig = ''
reverse_proxy localhost:8096
'';
};
system.stateVersion = "26.05";
};
};
}
|