about summary refs log tree commit diff
path: root/pkgs/applications/video/mpv/wrapper.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/video/mpv/wrapper.nix')
-rw-r--r--pkgs/applications/video/mpv/wrapper.nix14
1 files changed, 14 insertions, 0 deletions
diff --git a/pkgs/applications/video/mpv/wrapper.nix b/pkgs/applications/video/mpv/wrapper.nix
new file mode 100644
index 000000000000..624c06414fd3
--- /dev/null
+++ b/pkgs/applications/video/mpv/wrapper.nix
@@ -0,0 +1,14 @@
+{ stdenv, symlinkJoin, makeWrapper, mpv, scripts ? [] }:
+
+symlinkJoin {
+  name = "mpv-with-scripts-${mpv.version}";
+
+  paths = [ mpv ];
+
+  buildInputs = [ makeWrapper ];
+
+  postBuild = ''
+    wrapProgram $out/bin/mpv \
+      --add-flags "${stdenv.lib.concatMapStringsSep " " (x: "--script=" + x) scripts}"
+  '';
+}