nixos-hypervisor/services/jellyfin-nvidia/default.nix
Théo Barnouin 32b60f1ff9
Some checks are pending
/ Build Nix targets (push) Waiting to run
Try pre-commit and formatting with alejandra
2025-06-05 10:42:50 +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"
];
};
};
}