jellyfin/flake.nix

60 lines
1.9 KiB
Nix
Raw Normal View History

2024-09-08 16:36:57 +00:00
{
description = "Jellyfin Server";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
jellyfin-package = pkgs.buildDotnetModule {
pname = "jellyfin";
version = "0.0.1";
# src = fetchFromGitHub {
# owner = "some_owner";
# repo = pname;
# rev = "v${version}";
# hash = ""; # use e.g. `nix-prefetch-git`
# };
src = ./Jellyfin.Server;
projectFile = "Jellyfin.Server/Jellyfin.Server.csproj";
dotnet-sdk = pkgs.dotnet-sdk_8;
dotnet-runtime = pkgs.dotnet-runtime_8;
nugetDeps = ./deps.nix; # create a blank file here, then populate it with `nix-build -A fetch-deps && ./result`
meta = with pkgs.lib; {
homepage = "https://jellyfin.org";
description = "Jellyfin Server";
license = licenses.mit;
};
runtimeDeps = [ pkgs.ffmpeg ]; # This will wrap ffmpeg's library path into `LD_LIBRARY_PATH`.
};
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
dotnet-sdk_8
dotnetPackages.Nuget
omnisharp-roslyn
mono
];
shellHook = ''
echo "Welcome to the .NET 8 development environment!"
echo "dotnet version: $(dotnet --version)"
'';
DOTNET_ROOT = "${pkgs.dotnet-sdk_8}";
LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib64:$LD_LIBRARY_PATH";
};
packages.jellyfin = jellyfin-package;
defaultPackage = jellyfin-package;
});
}