mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
nixos/jellyfin: added a package option to the options section, defaults to using the default jellyfin package if nixos version is 20.09 or greater, otherwise will default to using the new jellyfin_10_5 derivation for older systems.
This commit is contained in:
parent
6a71fd341d
commit
ce9f0c42f9
1 changed files with 14 additions and 1 deletions
|
@ -16,6 +16,14 @@ in
|
||||||
description = "User account under which Jellyfin runs.";
|
description = "User account under which Jellyfin runs.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
example = literalExample "pkgs.jellyfin";
|
||||||
|
description = ''
|
||||||
|
Jellyfin package to use.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
group = mkOption {
|
group = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "jellyfin";
|
default = "jellyfin";
|
||||||
|
@ -35,11 +43,16 @@ in
|
||||||
Group = cfg.group;
|
Group = cfg.group;
|
||||||
StateDirectory = "jellyfin";
|
StateDirectory = "jellyfin";
|
||||||
CacheDirectory = "jellyfin";
|
CacheDirectory = "jellyfin";
|
||||||
ExecStart = "${pkgs.jellyfin}/bin/jellyfin --datadir '/var/lib/${StateDirectory}' --cachedir '/var/cache/${CacheDirectory}'";
|
ExecStart = "${cfg.package}/bin/jellyfin --datadir '/var/lib/${StateDirectory}' --cachedir '/var/cache/${CacheDirectory}'";
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.jellyfin.package = mkDefault (
|
||||||
|
if versionAtLeast config.system.stateVersion "20.09" then pkgs.jellyfin
|
||||||
|
else pkgs.jellyfin_10_5
|
||||||
|
);
|
||||||
|
|
||||||
users.users = mkIf (cfg.user == "jellyfin") {
|
users.users = mkIf (cfg.user == "jellyfin") {
|
||||||
jellyfin = {
|
jellyfin = {
|
||||||
group = cfg.group;
|
group = cfg.group;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue