nixos-configs/configurations/nos/modules/subtitles/convert.nix

21 lines
292 B
Nix
Raw Normal View History

{
writeShellApplication,
ffmpeg-full,
...
}:
writeShellApplication {
name = "convert-mkv";
runtimeInputs = [ffmpeg-full];
text = ''
extension="$1"
file="$2"
new_file="''${file%."$extension"}.mkv"
ffmpeg -i "$file" -c copy "$new_file" &&
rm "$file"
'';
}