Added jellyfin setup

This commit is contained in:
ari committed 2024-08-20 20:57:29 -04:00
1 parent 25c575b534
commit dc8e0b81d9
5 files changed
+96 -47

No files matched your search

+2 -46
View File
@@ -1,18 +1,11 @@
{ user }:
{ pkgs, lib, config, ... }:
let
openPorts = [
22
11434
10400
10300
10200
];
in
{
imports = [ ./hl-bigbox1.hardware-configuration.nix ];
skyg.user.enabled = true;
skyg.nixos.common.ssh-server.enabled = true;
skyg.nixos.server.services.ai.enable = true;
skyg.nixos.server.services.jellyfin.enable = true;
# firmware updater
services.fwupd.enable = true;
virtualisation.docker.enableNvidia = true;
@@ -22,40 +15,6 @@ in
boot.loader.efi.canTouchEfiVariables = true;
boot.tmp.useTmpfs = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
# Containers
virtualisation.oci-containers = {
containers = {
ollama = {
autoStart = true;
image = "ollama/ollama";
extraOptions = [ "--gpus" "all" ];
ports = [ "11434:11434" ];
volumes = [ "ollama:/root/.ollama" ];
};
openwakeword = {
autoStart = true;
image = "rhasspy/wyoming-openwakeword";
cmd = [ "--preload-model" "ok_nabu" ];
ports = [ "10400:10400" ];
};
};
};
# Wyoming Service
services.wyoming = {
faster-whisper.servers.main-eng = {
enable = true;
device = "cpu";
model = "medium.en";
language = "en";
uri = "tcp://0.0.0.0:10300";
};
piper.servers.pier = {
enable = true;
uri = "tcp://0.0.0.0:10200";
voice = "en_GB-alan-medium";
};
};
# Nvidia Settings
services.xserver.videoDrivers = [ "nvidia" ];
services.xserver.enable = true;
@@ -89,7 +48,4 @@ in
steamPackages.steamcmd
ollama
];
# Networking
networking.firewall.allowedUDPPorts = openPorts;
networking.firewall.allowedTCPPorts = openPorts;
}
+1 -1
View File
@@ -14,7 +14,7 @@ in
};
};
config = mkIf cfg.enabled {
fileSystems."/mnt/EightTerra/DownloadedTorrents" = {
fileSystems."/torrents" = {
device = "tnas1.lab.internal:/mnt/EightTerra/DownloadedTorrents";
fsType = "nfs";
options = [ "x-systemd.automount" "noauto" ];
+57
View File
@@ -0,0 +1,57 @@
{ config, lib, ... }:
with lib;
let
cfg = config.skyg.nixos.server.services.ai;
openPorts = [
11434
10400
10300
10200
];
in
{
options = {
skyg.nixos.server.services.ai = {
enable = mkEnableOption
"Enable AI Services";
};
};
config = mkIf cfg.enable {
networking.firewall.allowedUDPPorts = openPorts;
networking.firewall.allowedTCPPorts = openPorts;
virtualisation.oci-containers = {
containers = {
ollama = {
autoStart = true;
image = "ollama/ollama";
extraOptions = [ "--gpus" "all" ];
ports = [ "11434:11434" ];
volumes = [ "ollama:/root/.ollama" ];
};
openwakeword = {
autoStart = true;
image = "rhasspy/wyoming-openwakeword";
cmd = [ "--preload-model" "ok_nabu" ];
ports = [ "10400:10400" ];
};
};
};
services.wyoming = {
faster-whisper.servers.main-eng = {
enable = true;
device = "cpu";
model = "medium.en";
language = "en";
uri = "tcp://0.0.0.0:10300";
};
piper.servers.pier = {
enable = true;
uri = "tcp://0.0.0.0:10200";
voice = "en_GB-alan-medium";
};
};
};
}
+2
View File
@@ -4,5 +4,7 @@
./audiobookshelf.nix
./coral-tpu-udev.nix
./exporters.nix
./ai-services.nix
./jellyfin.nix
];
}
+34
View File
@@ -0,0 +1,34 @@
{ config, lib, ... }:
with lib;
let
cfg = config.skyg.nixos.server.services.jellyfin;
in
{
options = {
skyg.nixos.server.services.jellyfin = {
enable = mkEnableOption
"Enable AI Services";
};
};
config = mkIf cfg.enable {
services.jellyfin = {
enable = true;
dataDir = "/mnt/apps/jellyfin/datadir";
configDir = "/mnt/apps/jellyfin/configdir";
openFirewall = true;
};
fileSystems."/mnt/apps/jellyfin" = {
device = "terra1.lab.internal:/mnt/Data/apps/jellyfin";
fsType = "nfs";
options = [ "x-systemd.automount" "noauto" ];
};
fileSystems."/family-videos" = {
device = "tnas1.lab.internal:/mnt/EightTerra/FamilyStorage/Video";
fsType = "nfs";
options = [ "x-systemd.automount" "noauto" ];
};
};
}