Files
jellyfin-nix/flake.nix
2025-03-05 19:37:14 +00:00

79 lines
2.6 KiB
Nix

{
description = "Jellyfin NixOS flake for incus";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
};
outputs =
{
self,
nixpkgs,
}@inputs:
{
nixosConfigurations = {
container = inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
"${inputs.nixpkgs}/nixos/modules/virtualisation/lxc-container.nix"
(
{ pkgs, ... }:
{
# Overlay to enable introskipper plugin, but keep in mind you have to install it over the web interface
nixpkgs.overlays = with pkgs; [
(final: prev: {
jellyfin-web = prev.jellyfin-web.overrideAttrs (
finalAttrs: previousAttrs: {
installPhase = ''
runHook preInstall
# this is the important line
sed -i "s#</head>#<script src=\"configurationpage?name=skip-intro-button.js\"></script></head>#" dist/index.html
mkdir -p $out/share
cp -a dist $out/share/jellyfin-web
runHook postInstall
'';
}
);
})
];
# Maybe we can use it because "kleiner-scheisser" has an intel cpu
# 1. enable vaapi on OS-level
# nixpkgs.config.packageOverrides = pkgs: {
# vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
# };
# hardware.graphics = {
# # hardware.opengl in 24.05
# enable = true;
# extraPackages = with pkgs; [
# intel-media-driver
# intel-vaapi-driver # previously vaapiIntel
# vaapiVdpau
# intel-compute-runtime # OpenCL filter support (hardware tonemapping and subtitle burn-in)
# vpl-gpu-rt # QSV on 11th gen or newer
# intel-media-sdk # QSV up to 11th gen
# ];
# };
services.jellyfin = {
enable = true;
group = "jellyfin";
user = "jellyfin";
openFirewall = true;
};
environment.systemPackages = with pkgs; [
jellyfin
jellyfin-web
jellyfin-ffmpeg
vim
];
}
)
];
};
};
};
}