feat(tilo): add Plex configuration for Tilo

This commit is contained in:
Lucien Cartier-Tilet 2025-08-04 21:39:49 +02:00
parent 1eb4476006
commit 319d292fa0
3 changed files with 40 additions and 0 deletions

View File

@ -39,6 +39,10 @@
};
services = {
endlessh.enable = true;
plex = {
enable = true;
dataDir = "/tank/web/stacks/plex/plex-config";
};
ssh = {
enable = true;
allowedUsers = ["phundrak"];

View File

@ -2,6 +2,7 @@
imports = [
./endlessh.nix
./fwupd.nix
./plex.nix
./printing.nix
./ssh.nix
./sunshine.nix

35
system/services/plex.nix Normal file
View File

@ -0,0 +1,35 @@
{
lib,
config,
...
}:
with lib; let
cfg = config.system.services.plex;
in {
options.system.services.plex = {
enable = mkEnableOption "Enable Plex";
group = mkOption {
type = types.string;
default = "users";
example = "users";
description = "Group under which Plex runs";
};
dataDir = mkOption {
type = types.string;
example = "/tank/plex-config";
};
user = mkOption {
type = types.string;
default = "phundrak";
};
};
config = {
services.plex = mkIf cfg.enable {
inherit (cfg) enable user group dataDir;
openFirewall = cfg.enable;
};
boot.kernel.sysctl = {
"kernel.unprivileged_userns_clone" = 1;
};
};
}