nixos-configs/devices/nos/modules/subtitles/convert.nix
matt1432 194c140dc1
All checks were successful
Discord / discord commits (push) Has been skipped
refactor: replace 'with' with attrValues
2024-08-31 19:16:06 -04:00

21 lines
321 B
Nix

{pkgs, ...}:
pkgs.writeShellApplication {
name = "convertMkv";
runtimeInputs = builtins.attrValues {
inherit
(pkgs)
ffmpeg-full
;
};
text = ''
extension="$1"
file="$2"
new_file="''${file%."$extension"}.mkv"
ffmpeg -i "$file" -c copy "$new_file" &&
rm "$file"
'';
}