adding jellyfin
This commit is contained in:
@@ -24,6 +24,9 @@
|
||||
smb.enable = true;
|
||||
nfs.enable = true;
|
||||
};
|
||||
services = {
|
||||
jellyfin.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
# enable users
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
./zfs.nix
|
||||
./smb.nix
|
||||
./nfs.nix
|
||||
./services/default.nix
|
||||
];
|
||||
|
||||
modules.homelab.zfs.enable = lib.mkDefault false;
|
||||
|
||||
21
modules/homelab/services/.template.nix
Normal file
21
modules/homelab/services/.template.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.modules.services.<name>;
|
||||
in
|
||||
{
|
||||
options.modules.system.docker = {
|
||||
enable = lib.mkEnableOption "enables <name>";
|
||||
# extra options
|
||||
# mode = lib.mkOption {
|
||||
# type = lib.types.enum [ "server" "client" ];
|
||||
# default = "client";
|
||||
# description = "whether syncthing should run as a client (user) or server (system-wide).";
|
||||
# };
|
||||
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
};
|
||||
}
|
||||
@@ -2,10 +2,13 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
|
||||
{
|
||||
# not yet
|
||||
# imports = [
|
||||
# ];
|
||||
|
||||
imports = [
|
||||
./jellyfin/default.nix
|
||||
|
||||
];
|
||||
|
||||
|
||||
modules.services.jellyfin.enable = lib.mkDefault false;
|
||||
|
||||
}
|
||||
|
||||
41
modules/homelab/services/jellyfin/default.nix
Normal file
41
modules/homelab/services/jellyfin/default.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{ pkgs, config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.modules.services.jellyfin;
|
||||
in
|
||||
{
|
||||
options.modules.system.docker = {
|
||||
enable = lib.mkEnableOption "enables jellyfin";
|
||||
# extra options
|
||||
# mode = lib.mkOption {
|
||||
# type = lib.types.enum [ "server" "client" ];
|
||||
# default = "client";
|
||||
# description = "whether syncthing should run as a client (user) or server (system-wide).";
|
||||
# };
|
||||
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
# declare jellyfin group
|
||||
users.groups.jellyfin = { gid = 701; };
|
||||
# declare jellyfin user
|
||||
users.users.jellyfin = {
|
||||
description = "jellyfin media server user";
|
||||
uid = 701;
|
||||
isSystemUser = true;
|
||||
home = "/var/lib/jellyfin";
|
||||
createHome = true;
|
||||
group = "jellyfin";
|
||||
extraGroups = [ "media" "video" "render" ];
|
||||
};
|
||||
|
||||
services.jellyfin = {
|
||||
enable = true;
|
||||
openFirewall = true; # Opens 8096/8920 automatically
|
||||
user = "jellyfin"; # Default: jellyfin
|
||||
group = "jellyfin"; # Default: jellyfin
|
||||
dataDir = "/var/lib/jellyfin"; # Config + metadata storage
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user