From 5676fd3ac1875559d99d7d60d75680097f8b7041 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Sun, 7 Jan 2024 22:35:38 +0100 Subject: [PATCH] dvd and blu-ray playback and backup --- hosts/yodaTab/configuration.nix | 1 + hosts/yodaTux/configuration.nix | 1 + modules/gnome-base.nix | 1 + modules/vlc-dvd-blu-ray.nix | 53 +++++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 modules/vlc-dvd-blu-ray.nix diff --git a/hosts/yodaTab/configuration.nix b/hosts/yodaTab/configuration.nix index a3a9c40..0402856 100644 --- a/hosts/yodaTab/configuration.nix +++ b/hosts/yodaTab/configuration.nix @@ -31,6 +31,7 @@ ../../modules/syncthing.nix ../../modules/signal-desktop.nix ../../modules/obsidian.nix + ../../modules/vlc-dvd-blu-ray.nix ../../modules/firefox.nix ../../modules/thunderbird.nix ../../modules/tor-browser.nix diff --git a/hosts/yodaTux/configuration.nix b/hosts/yodaTux/configuration.nix index 2d33b7f..8a408af 100644 --- a/hosts/yodaTux/configuration.nix +++ b/hosts/yodaTux/configuration.nix @@ -32,6 +32,7 @@ ../../modules/syncthing.nix ../../modules/signal-desktop.nix ../../modules/obsidian.nix + ../../modules/vlc-dvd-blu-ray.nix ../../modules/firefox.nix ../../modules/thunderbird.nix ../../modules/tor-browser.nix diff --git a/modules/gnome-base.nix b/modules/gnome-base.nix index c40f449..d905aa2 100644 --- a/modules/gnome-base.nix +++ b/modules/gnome-base.nix @@ -17,6 +17,7 @@ #gnome.gnome-contacts # Address book gnome.gnome-font-viewer # View and install fonts gnome.gnome-system-monitor # Resource monitor / task manager + gnome.totem # Video player ]); # GNOME Calendar comes preinstalled. https://nixos.wiki/wiki/GNOME/Calendar diff --git a/modules/vlc-dvd-blu-ray.nix b/modules/vlc-dvd-blu-ray.nix new file mode 100644 index 0000000..d8f159e --- /dev/null +++ b/modules/vlc-dvd-blu-ray.nix @@ -0,0 +1,53 @@ +# VLC Blu-ray playback with NixOS +# Requires libaacs and libbdplus +# Solution: https://github.com/NixOS/nixpkgs/issues/63641#issuecomment-505039827 + +# We do also need some databases ... +# Here is a script describing the necessary steps. +# Source: https://github.com/puppylinux-woof-CE/woof-CE/blob/849a9faa7ea8cac74e04d04e4f99f4425652c26b/woof-code/rootfs-skeleton/usr/local/bin/bdplayback_aacs +# +# # db for libaacs: http://www.videolan.org/developers/libaacs.html +# mkdir -p ~/.config/aacs +# ( +# cd ~/.config/aacs +# wget http://www.labdv.com/aacs/KEYDB.cfg +# ) +# +# # db for libbdplus: http://www.videolan.org/developers/libbdplus.html +# mkdir -p ~/.config/bdplus +# ( +# cd ~/.config +# wget http://www.labdv.com/aacs/libbdplus/bdplus-vm0.bz2 +# tar -xvjf bdplus-vm0.bz2 +# rm bdplus-vm0.bz2 +# ) + +# More details on `libbluray`. +# From the source code +# https://github.com/NixOS/nixpkgs/blob/2ab31359946cd78a509b61931cbf7de7beebdd6f/pkgs/development/libraries/libbluray/default.nix#L2C4-L6 +# , withJava ? false, jdk, ant +# , withAACS ? false, libaacs +# , withBDplus ? false, libbdplus +# , withMetadata ? true, libxml2 +# , withFonts ? true, freetype +# we can read that Java, AACS and BD+ support can be enabled. + +# Back-up a personal DVD: +# dvdbackup -i /dev/sr0 --mirror --progress -o ~/Downloads/ && eject /dev/sr0 + +{ config, pkgs, ... }: +let + libbluray = pkgs.libbluray.override { + withAACS = true; + withBDplus = true; + }; + vlc = pkgs.vlc.override { inherit libbluray; }; +in +{ + users.users.yoda = { + packages = [ + vlc # Video (DVD, Blu-ray) and audio player + pkgs.dvdbackup # Create ackups of personal DVDs + ]; + }; +}