Enabling transcoding for jellyfin in docker

Good day,

Thanks for reading this, I am currently hitting a wall and clearly out of my depth here. Mind you I am still new to linux and nixos in general so please go easy on me if I made a stupid mistake.

I am trying to setup nvidia transcoding on jellyfin.
I have jellyfin setup.
I have ( at least I think I have) nvidia drivers installed. At least it says that in System/About/system Details.
I have a RTX 3060. and that is the only gpu I have in the system.

What is in my config file:

#nvidia Drivers

Enable OpenGL

hardware.opengl = {
enable = true;
};

Load nvidia driver for Xorg and Wayland

services.xserver.videoDrivers = [“nvidia”];

hardware.nvidia = {

# Modesetting is required.
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;

# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;

# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of 
# supported GPUs is at: 
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus 
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false;

# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;

# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.stable;

};

#Docker
virtualisation.docker.enable = true;
virtualisation.docker.rootless = {
enable = true;
setSocketVariable = true;
};

environment.systemPackages = with pkgs; [
nvidia-docker
nvidia-container-toolkit
docker
docker-compose
]

Things I had in but didnt work or would crash docker or jellyfin

Optional: Ensure Docker can use the NVIDIA runtime

virtualisation.docker.extraOptions = “–default-runtime=nvidia”;

Optional: Specify NVIDIA container runtime if needed

virtualisation.docker.runtimes = {
nvidia = {
path = “nvidia-container-runtime”;
runtimeArgs = ;
};
};

Current YAML file

version: “2.1”
services:
jellyfin:
image: lscr.io/linuxserver/jellyfin:latest
container_name: jellyfin
environment:
- PUID=1000
- PGID=1000
- TZ=Korea/Seoul
- JELLYFIN_PublishedServerUrl=10.27.27.49 #optional
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all

volumes:
  - /home/user/docker/jellyfin/metadata:/metadata
  - /home/user/docker/jellyfin/cache:/cache
  - /home/user/docker/jellyfin/data:/data
  - /home/user/docker/jellyfin/config:/config
  - /home/user/docker/jellyfin/transcode:/transcode
  - /mnt/myshare/media:/media


ports:
  - 8096:8096
restart: unless-stopped

Things I had but it wouldnt work, it would allways say it doesnt know what nvidia is
1)
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [“gpu”, “utility”]
2) runtime: nvidia

Thanks again for anyhelp
J