From 71256b7ff44645082a60dc9ee229b5c87d656bf5 Mon Sep 17 00:00:00 2001 From: Skye Date: Thu, 14 Nov 2024 17:05:17 -0500 Subject: [PATCH] Make nix package properly depend on `mkvtoolnix-cli` --- flake.nix | 3 ++- src/main.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index c3702d6..17f0e5f 100644 --- a/flake.nix +++ b/flake.nix @@ -20,8 +20,9 @@ src = ./.; cargoLock.lockFile = ./Cargo.lock; buildInputs = builtins.attrValues { - inherit (final) installShellFiles mkvtoolnix-cli; + inherit (final) installShellFiles; }; + env.mkvmerge = "${final.mkvtoolnix-cli}/bin/mkvmerge"; postInstall = '' installShellCompletion --cmd subtitle-merge \ diff --git a/src/main.rs b/src/main.rs index 31dd22f..af63d18 100644 --- a/src/main.rs +++ b/src/main.rs @@ -111,7 +111,7 @@ fn convert_single( find_files(source.parent().unwrap(), OsStr::new("ttf"))?.collect::>()? }; - let mut command = Command::new("mkvmerge"); + let mut command = Command::new(option_env!("mkvmerge").unwrap_or("mkvmerge")); command.arg("--output").args([ output.into_os_string(), source.into_os_string(),