nixos-hypervisor/services/jellyfin-nvidia/default.nix
Théo Barnouin cdbdfb278d
Some checks are pending
/ Build Nix targets (push) Waiting to run
Add nix arr-box config because why do this with docker in the first place
2025-05-14 18:26:03 +02:00

57 lines
1.5 KiB
Nix

{
lib,
config,
pkgs,
...
}: let
cfg = config.services.vm_jellyfin_nvidia;
in {
options.services.vm_jellyfin_nvidia = {
enable = lib.mkEnableOption "Enable minimal config";
};
config = lib.mkIf cfg.enable {
environment = {
systemPackages = with pkgs; [
nvtopPackages.nvidia
];
};
# Nvidia Hardware Acceleration config
services.xserver.videoDrivers = [ "nvidia" ];
hardware = {
graphics = {
enable = true;
extraPackages = with pkgs; [ cudaPackages.cudatoolkit ];
};
nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.latest;
nvidiaSettings = true;
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = false;
powerManagement.finegrained = false;
# Use the NVidia open source kernel module
# Recommended by Nvidia for 20+ series GPU
open = true;
};
};
services = {
jellyfin = {
enable = true;
user = "tbarnouin";
openFirewall = true;
};
};
fileSystems."/mnt/media" = {
device = "192.168.1.125:/BIGDATA";
fsType = "nfs";
options = [
"x-systemd.automount"
"noauto"
];
};
};
}