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(),