feat(shiro): jellyfin broke
This commit is contained in:
@@ -14,11 +14,11 @@
|
|||||||
trusted-users = ["root" "servius"];
|
trusted-users = ["root" "servius"];
|
||||||
substituters = [
|
substituters = [
|
||||||
"https://nix-community.cachix.org"
|
"https://nix-community.cachix.org"
|
||||||
"https://sh.darksailor.dev"
|
# "https://sh.darksailor.dev"
|
||||||
];
|
];
|
||||||
trusted-public-keys = [
|
trusted-public-keys = [
|
||||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
"mirai:bcVPoFGBZ0i7JAKMXIqLj2GY3CulLC4kP7rQyqes1RM="
|
# "mirai:bcVPoFGBZ0i7JAKMXIqLj2GY3CulLC4kP7rQyqes1RM="
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
extraOptions = ''
|
extraOptions = ''
|
||||||
@@ -28,8 +28,8 @@
|
|||||||
'';
|
'';
|
||||||
package = pkgs.nixVersions.latest;
|
package = pkgs.nixVersions.latest;
|
||||||
buildMachines = [
|
buildMachines = [
|
||||||
../../builders/mirai.nix
|
# ../../builders/mirai.nix
|
||||||
../../builders/shiro.nix
|
# ../../builders/shiro.nix
|
||||||
];
|
];
|
||||||
distributedBuilds = true;
|
distributedBuilds = true;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
services = {
|
services = {
|
||||||
jellyfin = {
|
jellyfin = {
|
||||||
enable = false;
|
enable = false;
|
||||||
# openFirewall = true;
|
|
||||||
};
|
};
|
||||||
# caddy = {
|
# caddy = {
|
||||||
# virtualHosts."media.darksailor.dev".extraConfig = ''
|
# virtualHosts."media.darksailor.dev".extraConfig = ''
|
||||||
|
|||||||
@@ -207,6 +207,7 @@
|
|||||||
name = "shiro";
|
name = "shiro";
|
||||||
system = "aarch64-darwin";
|
system = "aarch64-darwin";
|
||||||
user = "servius";
|
user = "servius";
|
||||||
|
isServer = true;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "SteamDeck";
|
name = "SteamDeck";
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
};
|
};
|
||||||
serverAliveInterval = 120;
|
serverAliveInterval = 120;
|
||||||
extraConfig =
|
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"
|
IdentityAgent "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"
|
||||||
''
|
''
|
||||||
|
|||||||
@@ -95,7 +95,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
# enableFishIntegration = true;
|
enableFishIntegration = false;
|
||||||
};
|
};
|
||||||
xdg.configFile."zellij/layouts/default.kdl" = {
|
xdg.configFile."zellij/layouts/default.kdl" = {
|
||||||
text =
|
text =
|
||||||
|
|||||||
@@ -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 = {
|
options.services.jellyfin = {
|
||||||
enable = mkEnableOption "Jellyfin Media Server";
|
enable = mkEnableOption "Jellyfin Media Server";
|
||||||
|
|
||||||
@@ -16,17 +17,17 @@ in
|
|||||||
description = "The package to use for Jellyfin";
|
description = "The package to use for Jellyfin";
|
||||||
};
|
};
|
||||||
|
|
||||||
user = mkOption {
|
# user = mkOption {
|
||||||
type = types.str;
|
# type = types.str;
|
||||||
default = "jellyfin";
|
# default = "jellyfin";
|
||||||
description = "User account under which Jellyfin runs.";
|
# description = "User account under which Jellyfin runs.";
|
||||||
};
|
# };
|
||||||
|
#
|
||||||
group = mkOption {
|
# group = mkOption {
|
||||||
type = types.str;
|
# type = types.str;
|
||||||
default = "jellyfin";
|
# default = "jellyfin";
|
||||||
description = "Group under which Jellyfin runs.";
|
# description = "Group under which Jellyfin runs.";
|
||||||
};
|
# };
|
||||||
|
|
||||||
dataDir = mkOption {
|
dataDir = mkOption {
|
||||||
type = types.path;
|
type = types.path;
|
||||||
@@ -36,39 +37,40 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
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 = {
|
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 = {
|
serviceConfig = {
|
||||||
|
# ProcessType = "Background";
|
||||||
Label = "org.jellyfin.server";
|
Label = "org.jellyfin.server";
|
||||||
RunAtLoad = true;
|
RunAtLoad = true;
|
||||||
KeepAlive = true;
|
# KeepAlive = true;
|
||||||
UserName = cfg.user;
|
UserName = "${config.users.users.jellyfin.name}";
|
||||||
GroupName = cfg.group;
|
GroupName = "${config.users.groups.jellyfin.name}";
|
||||||
|
StandardOutPath = "${cfg.dataDir}/log/jellyfin.log";
|
||||||
|
StandardErrorPath = "${cfg.dataDir}/log/jellyfin.error.log";
|
||||||
WorkingDirectory = cfg.dataDir;
|
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}
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user