feat(shiro): jellyfin broke

This commit is contained in:
uttarayan21
2025-02-13 00:16:28 +05:30
parent 8021a47841
commit ab2a805b9d
6 changed files with 53 additions and 51 deletions

View File

@@ -14,11 +14,11 @@
trusted-users = ["root" "servius"];
substituters = [
"https://nix-community.cachix.org"
"https://sh.darksailor.dev"
# "https://sh.darksailor.dev"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"mirai:bcVPoFGBZ0i7JAKMXIqLj2GY3CulLC4kP7rQyqes1RM="
# "mirai:bcVPoFGBZ0i7JAKMXIqLj2GY3CulLC4kP7rQyqes1RM="
];
};
extraOptions = ''
@@ -28,8 +28,8 @@
'';
package = pkgs.nixVersions.latest;
buildMachines = [
../../builders/mirai.nix
../../builders/shiro.nix
# ../../builders/mirai.nix
# ../../builders/shiro.nix
];
distributedBuilds = true;
};

View File

@@ -3,7 +3,6 @@
services = {
jellyfin = {
enable = false;
# openFirewall = true;
};
# caddy = {
# virtualHosts."media.darksailor.dev".extraConfig = ''

View File

@@ -207,6 +207,7 @@
name = "shiro";
system = "aarch64-darwin";
user = "servius";
isServer = true;
}
{
name = "SteamDeck";

View File

@@ -39,7 +39,7 @@
};
serverAliveInterval = 120;
extraConfig =
lib.strings.optionalString pkgs.stdenv.isDarwin
lib.strings.optionalString (pkgs.stdenv.isDarwin && !device.isServer)
''
IdentityAgent "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
''

View File

@@ -95,7 +95,7 @@
};
};
};
# enableFishIntegration = true;
enableFishIntegration = false;
};
xdg.configFile."zellij/layouts/default.kdl" = {
text =

View File

@@ -1,11 +1,12 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.jellyfin;
in
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.services.jellyfin;
in {
options.services.jellyfin = {
enable = mkEnableOption "Jellyfin Media Server";
@@ -16,17 +17,17 @@ in
description = "The package to use for Jellyfin";
};
user = mkOption {
type = types.str;
default = "jellyfin";
description = "User account under which Jellyfin runs.";
};
group = mkOption {
type = types.str;
default = "jellyfin";
description = "Group under which Jellyfin runs.";
};
# user = mkOption {
# type = types.str;
# default = "jellyfin";
# description = "User account under which Jellyfin runs.";
# };
#
# group = mkOption {
# type = types.str;
# default = "jellyfin";
# description = "Group under which Jellyfin runs.";
# };
dataDir = mkOption {
type = types.path;
@@ -36,39 +37,40 @@ in
};
config = mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
users.users.jellyfin = {
name = "jellyfin";
uid = mkDefault 601;
gid = mkDefault config.users.groups.jellyfin.gid;
home = cfg.dataDir;
createHome = true;
shell = "/bin/bash";
description = "Jellyfin runner user account";
};
users.groups.jellyfin = {
name = "jellyfin";
gid = mkDefault 602;
description = "Jellyfin runner group";
};
environment.systemPackages = [cfg.package];
launchd.daemons.jellyfin = {
command = "${lib.getExe cfg.package} --datadir '${cfg.dataDir}'";
environment = {
HOME = cfg.dataDir;
};
path = [cfg.package pkgs.coreutils pkgs.darwin.DarwinTools];
command = "${lib.getExe cfg.package}";
serviceConfig = {
# ProcessType = "Background";
Label = "org.jellyfin.server";
RunAtLoad = true;
KeepAlive = true;
UserName = cfg.user;
GroupName = cfg.group;
# KeepAlive = true;
UserName = "${config.users.users.jellyfin.name}";
GroupName = "${config.users.groups.jellyfin.name}";
StandardOutPath = "${cfg.dataDir}/log/jellyfin.log";
StandardErrorPath = "${cfg.dataDir}/log/jellyfin.error.log";
WorkingDirectory = cfg.dataDir;
StandardOutPath = "/var/log/jellyfin.log";
StandardErrorPath = "/var/log/jellyfin.error.log";
};
};
users.users = mkIf (cfg.user == "jellyfin") {
jellyfin = {
isSystemUser = true;
group = cfg.group;
home = cfg.dataDir;
createHome = true;
};
};
users.groups = mkIf (cfg.group == "jellyfin") {
jellyfin = {};
};
# Create necessary directories and set permissions
system.activationScripts.preActivation.text = ''
mkdir -p ${cfg.dataDir}
chown ${cfg.user}:${cfg.group} ${cfg.dataDir}
'';
};
}