makemkv: Init

This commit is contained in:
Simon Bruder 2022-04-01 18:20:46 +02:00
parent a88e4e053c
commit 5cb356c368
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC
3 changed files with 34 additions and 0 deletions

View file

@ -32,6 +32,7 @@ in
"drone-runner-exec" # exception: same as drone.io "drone-runner-exec" # exception: same as drone.io
"drone.io" # exception: is open source (but has usage restriction) "drone.io" # exception: is open source (but has usage restriction)
"fahclient" # exception: for science "fahclient" # exception: for science
"makemkv" # exception: runs in sandbox, only way to get DRM garbage to work properly
"p7zip" # exception: rar source code is not free, but available; p7zip with `enableUnfree` includes it "p7zip" # exception: rar source code is not free, but available; p7zip with `enableUnfree` includes it
# games (okay if they run sandboxed) # games (okay if they run sandboxed)

View file

@ -9,6 +9,7 @@
./gtk.nix ./gtk.nix
./htop.nix ./htop.nix
./logitech.nix ./logitech.nix
./makemkv.nix
./misc.nix ./misc.nix
./mpd.nix ./mpd.nix
./mpv ./mpv

View file

@ -0,0 +1,32 @@
{ lib, nixosConfig, pkgs, ... }:
let
# TODO: Do not hardcode /dev/{sr0,sg2} (right paths on sayuri)
makemkv-sandbox = pkgs.writeShellScriptBin "makemkv-sandbox" /* bash */ ''
set -euo pipefail
${pkgs.bubblewrap}/bin/bwrap \
--tmpfs /tmp \
--proc /proc \
--dev /dev \
--unshare-all \
--die-with-parent \
--ro-bind /nix/store /nix/store \
--dev-bind /dev/dri /dev/dri \
--ro-bind /sys/dev/char /sys/dev/char \
--ro-bind /sys/devices/pci0000:00 /sys/devices/pci0000:00 \
--ro-bind $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY $XDG_RUNTIME_DIR/$WAYLAND_DISPLAY \
--ro-bind /run/opengl-driver /run/opengl-driver \
--ro-bind /etc/fonts /etc/fonts \
--new-session \
--bind /home/simon/.MakeMKV /home/simon/.MakeMKV \
--dev-bind /dev/sr0 /dev/sr0 \
--dev-bind /dev/sg2 /dev/sg2 \
--dev-bind /sys/bus/scsi /sys/bus/scsi \
--bind $PWD $PWD \
${pkgs.unstable.makemkv}/bin/makemkv
'';
in
lib.mkIf (nixosConfig.sbruder.gui.enable && nixosConfig.sbruder.unfree.allowSoftware) {
home.packages = [
makemkv-sandbox
];
}