Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
if has nix; then
watch_file flake.nix
watch_file flake.lock
watch_file dev/nix/devShell.nix
use flake
fi

source_env_if_exists .envrc.local
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ third_party/*

# Local environment
.env
.direnv/

# Project-scoped MCP
.mcp.json
Expand Down
135 changes: 135 additions & 0 deletions dev/nix/devShell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{
mkShell,
lib,
stdenv,
alsa-lib,
at-spi2-atk,
at-spi2-core,
atk,
cairo,
cargo,
clippy,
cups,
dbus,
expat,
ffmpeg,
git,
glib,
just,
libass,
libdrm,
libgbm,
libGL,
libplacebo,
libXScrnSaver,
libx11,
libxcb,
libxcomposite,
libxdamage,
libxext,
libxfixes,
libxkbcommon,
libXpresent,
libxrandr,
meson,
ninja,
nspr,
nss,
pango,
pkg-config,
python3,
rustPlatform,
rustc,
rustfmt,
systemd,
vulkan-loader,
wayland,
wayland-protocols,
wayland-scanner,
}:

let
mpvBuildInputs = [
ffmpeg
libass
libdrm
libgbm
libGL
libplacebo
libXScrnSaver
libx11
libxext
libxkbcommon
libXpresent
libxrandr
vulkan-loader
wayland
wayland-protocols
wayland-scanner
];

cefRuntimeLibraries = [
alsa-lib
at-spi2-atk
at-spi2-core
atk
cairo
cups
dbus
expat
glib
libgbm
libx11
libxcomposite
libxdamage
libxext
libxfixes
libxrandr
nspr
nss
pango
systemd
];

appLinkLibraries = [
libxcb
libxkbcommon
];

runtimeLibraryPath = lib.makeLibraryPath (
cefRuntimeLibraries
++ mpvBuildInputs
++ appLinkLibraries
);
in
mkShell {
name = "jellyfin-desktop";

packages = [
cargo
clippy
git
just
meson
ninja
pkg-config
python3
rustPlatform.bindgenHook
rustc
rustfmt
]
++ lib.optionals stdenv.hostPlatform.isLinux (
mpvBuildInputs
++ cefRuntimeLibraries
++ appLinkLibraries
);

# Expose the runtime libary path so that `just run` can find the required libaries to run the app.
shellHook = lib.optionalString stdenv.hostPlatform.isLinux ''
export LD_LIBRARY_PATH="${runtimeLibraryPath}''${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"

if [ -z "''${XDG_RUNTIME_DIR:-}" ] || [ ! -w "''${XDG_RUNTIME_DIR:-}" ]; then
export XDG_RUNTIME_DIR="/tmp"
fi
'';
}
44 changes: 44 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
description = "Jellyfin Desktop development environment";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};

outputs =
{ nixpkgs, ... }:
let
systems = [
"x86_64-linux"
"aarch64-linux"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
in
{
devShells = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
default = pkgs.callPackage ./dev/nix/devShell.nix { };
}
);
};
}
12 changes: 12 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(import
(
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
flake-compat = lock.nodes.flake-compat;
in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${flake-compat.locked.rev}.tar.gz";
sha256 = flake-compat.locked.narHash;
}
)
{ src = ./.; }).shellNix