From cfffe9b704ce58f28dd566b6d877dda3dada8bd8 Mon Sep 17 00:00:00 2001 From: mcgi5sr2 Date: Sun, 5 Apr 2026 11:11:31 +0100 Subject: [PATCH] nix: add ffmpeg dependency for video background support ffmpeg is included conditionally via withVideoBackend (default true), allowing packagers to opt out by passing withVideoBackend = false, which also passes -DVIDEO_BACKEND=OFF to cmake. --- nix/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nix/default.nix b/nix/default.nix index 8a80871..774da9d 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -4,7 +4,7 @@ cmake, pkg-config, cairo, - ffmpeg, + ffmpeg ? null, libdrm, libGL, libxkbcommon, @@ -20,6 +20,7 @@ wayland, wayland-protocols, wayland-scanner, + withVideoBackend ? true, version ? "git", shortRev ? "", }: @@ -38,7 +39,6 @@ stdenv.mkDerivation { buildInputs = [ cairo - ffmpeg libdrm libGL libxkbcommon @@ -52,12 +52,12 @@ stdenv.mkDerivation { systemdLibs wayland wayland-protocols - ]; + ] ++ lib.optionals withVideoBackend [ ffmpeg ]; cmakeFlags = lib.mapAttrsToList lib.cmakeFeature { HYPRLOCK_COMMIT = shortRev; HYPRLOCK_VERSION_COMMIT = ""; # Intentionally left empty (hyprlock --version will always print the commit) - }; + } ++ lib.optional (!withVideoBackend) (lib.cmakeBool "VIDEO_BACKEND" false); meta = { homepage = "https://github.com/hyprwm/hyprlock";