dev.fron.io rc / ca6d7e3
hosts(zeta): add jellyfin container Tony Olagbaiye 11 months ago
5 changed file(s) with 65 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
0 { config, pkgs, lib, domains, ... }:
1
2 let
3 hostAddress = "10.11.0.1";
4 localAddress = "10.11.0.2";
5 in {
6 containers.jellyfin =
7 {
8 autoStart = true;
9 enableTun = true;
10 privateNetwork = true;
11 inherit hostAddress localAddress;
12
13 config =
14 { config, stdenv, ... }:
15
16 {
17 config = {
18 nixpkgs.pkgs = pkgs;
19
20 networking.firewall.enable = false;
21
22 environment.systemPackages = with pkgs; [
23 vervis yq yj jq git darcs
24 ];
25
26 services.jellyfin.enable = true;
27 };
28 };
29 bindMounts = {
30 "/var/lib/jellyfin" = {
31 hostPath = "/var/lib/jellyfin";
32 isReadOnly = false;
33 };
34 };
35 };
36
37 system.activationScripts.var-lib-jellyfin = ''
38 mkdir -p /var/lib/jellyfin
39 '';
40 }
77 databaseName = "vervis";
88 in {
99 environment.systemPackages = with pkgs; [
10 vervis
10 vervis
1111 ];
1212
1313 services.postgresql.enable = true;
212212 importas -i json JSON
213213
214214 backtick -i -n NAME {
215 heredoc 0 $json jq -r '.name'
215 heredoc 0 $json jq -r ".name"
216216 } importas -i name NAME
217217
218218 backtick -i -n SOURCE {
219 heredoc 0 $json jq -r '.source'
219 heredoc 0 $json jq -r ".source"
220220 } importas -i source SOURCE
221221
222222 backtick -i -n USER {
223 heredoc 0 $json jq -r '.user'
223 heredoc 0 $json jq -r ".user"
224224 } importas -i user USER
225225
226226 backtick -i -n GROUP {
227 heredoc 0 $json jq -r '.group'
227 heredoc 0 $json jq -r ".group"
228228 } importas -i group GROUP
229229
230230 foreground {
1111 ../../containers/hydroxide.nix # 10. 8.0.x
1212 ../../containers/anki.nix # 10. 9.0.x
1313 ../../containers/vervis.nix # 10.10.0.x
14 #../../containers/lemmy.nix # 10.11.0.x
14 ../../containers/jellyfin.nix # 10.11.0.x
15 #../../containers/lemmy.nix # 10.12.0.x
1516 ../../profiles/meta/fatal-warnings.nix
1617 ../../profiles/misc/qemu.nix
1718 ../../profiles/misc/restartssh.nix
129129 tls.domains = [
130130 { main = "dev.${domains.home}"; }
131131 { main = "rc.${domains.home}"; }
132 ];
133 };
134 jellyfin-http = {
135 entryPoints = [ "http" ];
136 rule = "Host(`media.${domains.home}`)";
137 service = "jellyfin";
138 };
139 jellyfin-https = jellyfin-http // {
140 entryPoints = [ "https" ];
141 tls.domains = [
142 { main = "media.${domains.home}"; }
132143 ];
133144 };
134145 #Router1 = {
439450 { url = "http://10.10.0.2:3000"; }
440451 ];
441452 };
453 jellyfin.loadBalancer = {
454 passHostHeader = true;
455 servers = [
456 { url = "http://10.11.0.2:8096"; }
457 ];
458 };
442459 #mirror-sample.mirroring = {
443460 # maxBodySize = 42;
444461 # mirrors = [