summaryrefslogtreecommitdiffstats
path: root/usecases/server
diff options
context:
space:
mode:
authorMinijackson <minijackson@riseup.net>2021-05-30 18:21:08 +0200
committerMinijackson <minijackson@riseup.net>2021-05-30 18:21:08 +0200
commitcc6d84beb848060535f006854927e7ea8126a98a (patch)
treef18215732b7c2e511d70ccbb99674c8ec6da9303 /usecases/server
parentbc6191454133e4e72413479ab9f6ee122010f6d9 (diff)
downloadnixos-config-reborn-cc6d84beb848060535f006854927e7ea8126a98a.tar.gz
nixos-config-reborn-cc6d84beb848060535f006854927e7ea8126a98a.zip
jellyfin: init
Diffstat (limited to 'usecases/server')
-rw-r--r--usecases/server/jellyfin.nix60
1 files changed, 60 insertions, 0 deletions
diff --git a/usecases/server/jellyfin.nix b/usecases/server/jellyfin.nix
new file mode 100644
index 0000000..6f62c34
--- /dev/null
+++ b/usecases/server/jellyfin.nix
@@ -0,0 +1,60 @@
1inputs:
2
3{ config, lib, pkgs, ... }:
4
5{
6 imports = [
7 (inputs.nixpkgs-unstable.outPath + "/nixos/modules/services/misc/jellyfin.nix")
8 ];
9
10 disabledModules = [ "services/misc/jellyfin.nix" ];
11
12 options = with lib; {
13 services.jellyfin.allowedPaths = mkOption {
14 type = with types; listOf str;
15 description = ''
16 A list of paths that Jellyfin is allowed to read
17 '';
18 };
19 };
20
21 config = {
22 services.jellyfin = {
23 enable = true;
24 package = pkgs.unstable.jellyfin;
25 };
26
27 networking.firewall.interfaces.${config.topology.mainVpn.interfaceName}.allowedTCPPorts = [
28 8096
29 ];
30
31 systemd.services.jellyfin.serviceConfig = {
32 # TODO: remove when #108224 is merged
33
34 # Allows access to drm devices for transcoding with hardware acceleration
35 SupplementaryGroups = [ "video" ];
36 # char-drm Allows ffmpeg to transcode with hardware acceleration
37 DeviceAllow = lib.mkForce [ "char-drm rw" ];
38
39 PrivateDevices = lib.mkForce false;
40
41 # ================================
42
43 # Personal:
44 ProtectHome = true;
45 ProtectSystem = "strict";
46
47 BindReadOnlyPaths = [
48 "/nix/store"
49
50 "/etc/ssl/certs"
51 "/etc/static/ssl/certs"
52 ] ++ lib.optional config.hardware.opengl.enable [
53 "/run/opengl-driver"
54 ] ++ config.services.jellyfin.allowedPaths;
55
56 RuntimeDirectory = "jellyfin";
57 RootDirectory = "/run/jellyfin";
58 };
59 };
60}