makemkv: Remove hardcodes/hard dependencies

Even without a drive it is useful for working with disc images.
This commit is contained in:
Simon Bruder 2022-05-05 16:29:18 +02:00
parent 8a116ff2ad
commit 4c01701af3
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC

View file

@ -3,6 +3,7 @@ let
# TODO: Do not hardcode /dev/{sr0,sg2} (right paths on sayuri) # TODO: Do not hardcode /dev/{sr0,sg2} (right paths on sayuri)
makemkv-sandbox = pkgs.writeShellScriptBin "makemkv-sandbox" /* bash */ '' makemkv-sandbox = pkgs.writeShellScriptBin "makemkv-sandbox" /* bash */ ''
set -euo pipefail set -euo pipefail
mkdir -p $HOME/.MakeMKV
${pkgs.bubblewrap}/bin/bwrap \ ${pkgs.bubblewrap}/bin/bwrap \
--tmpfs /tmp \ --tmpfs /tmp \
--proc /proc \ --proc /proc \
@ -17,10 +18,10 @@ let
--ro-bind /run/opengl-driver /run/opengl-driver \ --ro-bind /run/opengl-driver /run/opengl-driver \
--ro-bind /etc/fonts /etc/fonts \ --ro-bind /etc/fonts /etc/fonts \
--new-session \ --new-session \
--bind /home/simon/.MakeMKV /home/simon/.MakeMKV \ --bind $HOME/.MakeMKV $HOME/.MakeMKV \
--dev-bind /dev/sr0 /dev/sr0 \ --dev-bind-try /dev/sr0 /dev/sr0 \
--dev-bind /dev/sg2 /dev/sg2 \ --dev-bind-try /dev/sg2 /dev/sg2 \
--dev-bind /sys/bus/scsi /sys/bus/scsi \ --dev-bind-try /sys/bus/scsi /sys/bus/scsi \
--bind ''${PWD_TARGET:-$PWD} ''${PWD_TARGET:-$PWD} \ --bind ''${PWD_TARGET:-$PWD} ''${PWD_TARGET:-$PWD} \
${pkgs.unstable.makemkv}/bin/makemkv ${pkgs.unstable.makemkv}/bin/makemkv
''; '';