server and other shit
This commit is contained in:
parent
270e1a0be4
commit
804371bf96
65 changed files with 1428 additions and 619 deletions
13
modules/server/media/default.nix
Normal file
13
modules/server/media/default.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./jellyfin.nix
|
||||
./navidrome.nix
|
||||
];
|
||||
}
|
||||
|
|
@ -11,64 +11,67 @@
|
|||
enable = lib.mkEnableOption "enable jelyfin";
|
||||
port = lib.mkOption {
|
||||
default = 8096;
|
||||
description = "set jellyfin port"
|
||||
description = "set jellyfin port";
|
||||
};
|
||||
public = {
|
||||
enable = lib.mkEnableOption "make jellyfin public";
|
||||
subdomain = lib.mkOption {
|
||||
default = "watch";
|
||||
description = "set jellyfin subdomain";
|
||||
};
|
||||
public = lib.mkEnableOption "make jellyfin public";
|
||||
subdomain = lib.mkOption {
|
||||
default = "watch";
|
||||
description = "set jellyfin subdomain";
|
||||
};
|
||||
};
|
||||
jellyseer = {
|
||||
enable = lib.mkEnableOption "enable jellyseer";
|
||||
port = lib.mkOption {
|
||||
default = 8097;
|
||||
description = "set jellyseer port"
|
||||
description = "set jellyseer port";
|
||||
};
|
||||
public = {
|
||||
enable = lib.mkEnableOption "make jellyseer public";
|
||||
subdomain = lib.mkOption {
|
||||
default = "jellyseer";
|
||||
description = "set jellyseer subdomain";
|
||||
};
|
||||
public = lib.mkEnableOption "make jellyseer public";
|
||||
subdomain = lib.mkOption {
|
||||
default = "jellyseer";
|
||||
description = "set jellyseer subdomain";
|
||||
};
|
||||
};
|
||||
};
|
||||
config = {
|
||||
environment.systemPackages = config.server.jellyfin.enable [
|
||||
pkgs.jellyfin
|
||||
pkgs.jellyfin-web
|
||||
pkgs.jellyfin-ffmpeg
|
||||
];
|
||||
environment.systemPackages =
|
||||
[ ]
|
||||
++ (
|
||||
if config.server.jellyfin.enable then
|
||||
[
|
||||
pkgs.jellyfin
|
||||
pkgs.jellyfin-web
|
||||
pkgs.jellyfin-ffmpeg
|
||||
]
|
||||
else
|
||||
[ ]
|
||||
);
|
||||
services = {
|
||||
jellyfin = lib.mkIf config.server.jellyfin.enable {
|
||||
enable = true;
|
||||
|
||||
};
|
||||
jellyseer = lib.mkIf config.server-jellyseer.enable {
|
||||
seerr = lib.mkIf config.server.jellyseer.enable {
|
||||
enable = true;
|
||||
};
|
||||
nginx.virtualHosts = {
|
||||
"${config.server.jellyfin.public.subdomain}.${config.domain}" =
|
||||
lib.mkIf config.server.jellyfin.public.enable
|
||||
{
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${config.server.jellyfin.port}";
|
||||
"${config.server.jellyfin.subdomain}.${config.networking.domain}" =
|
||||
lib.mkIf config.server.jellyfin.public
|
||||
{
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${config.server.jellyfin.port}";
|
||||
};
|
||||
};
|
||||
};
|
||||
"${config.server.jellyseer.public.subdomain}.${config.domain}" = lib.mkIf config.server.jellyfin.public.enable {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${config.server.jellyseer.port}";
|
||||
"${config.server.jellyseer.subdomain}.${config.networking.domain}" =
|
||||
lib.mkIf config.server.jellyfin.public
|
||||
{
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${config.server.jellyseer.port}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
66
modules/server/media/navidrome.nix
Normal file
66
modules/server/media/navidrome.nix
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
options = {
|
||||
server.media.navidrome = {
|
||||
enable = lib.mkEnableOption "enable navidrome";
|
||||
port = lib.mkOption {
|
||||
default = 4533;
|
||||
description = "navidrome port";
|
||||
};
|
||||
public = lib.mkEnableOption "make navidrome public";
|
||||
subdomain = lib.mkOption {
|
||||
default = "music";
|
||||
description = "navidrome subdomain";
|
||||
};
|
||||
};
|
||||
};
|
||||
config = {
|
||||
services = {
|
||||
navidrome = {
|
||||
enable = config.server.media.navidrome.enable;
|
||||
user = config.user.userName;
|
||||
group = "users";
|
||||
settings = {
|
||||
Address = "0.0.0.0";
|
||||
Port = config.server.media.navidrome.port;
|
||||
MusicFolder = "/mnt/Data/Media/Music";
|
||||
Agents = "lastfm";
|
||||
AlbumPlayCountMode = "normalized";
|
||||
EnableDownloads = true;
|
||||
EnableFavourites = true;
|
||||
EnableNowPlaying = true;
|
||||
EnableStarRating = true;
|
||||
EnableUserEditing = true;
|
||||
LastFM.Enabled = true;
|
||||
LastFM.Language = "en";
|
||||
LastFM.ScrobbleFirstArtistOnly = false;
|
||||
ListenBrainz.Enabled = true;
|
||||
Scanner.Enabled = true;
|
||||
Scanner.Schedule = "1h";
|
||||
Subsonic.ArtistParticipations = true;
|
||||
};
|
||||
};
|
||||
nginx = {
|
||||
virtualHosts = {
|
||||
"${config.server.media.navidrome.subdomain}.${config.networking.domain}" =
|
||||
if config.server.media.navidrome.public then
|
||||
{
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString config.server.media.navidrome.port}";
|
||||
};
|
||||
}
|
||||
else
|
||||
{ };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue