From aaaf7d3ccc810a2e6620ad6cb301283fb16cb29a Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Sat, 15 Oct 2022 23:27:12 +0200 Subject: [PATCH] Move Blu-ray drive from sayuri to fuuko MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This removes makemkv-specific configuration from sayuri and adds it to fuuko. It also changes the makemkv sandbox to now hardcode fuuko’s configuration. --- machines/fuuko/hardware-configuration.nix | 2 +- machines/sayuri/hardware-configuration.nix | 2 +- users/simon/default.nix | 1 + users/simon/modules/makemkv.nix | 14 ++++++-------- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/machines/fuuko/hardware-configuration.nix b/machines/fuuko/hardware-configuration.nix index ac2f1ef..5921640 100644 --- a/machines/fuuko/hardware-configuration.nix +++ b/machines/fuuko/hardware-configuration.nix @@ -7,7 +7,7 @@ ]; boot = { - kernelModules = [ "kvm-amd" ]; + kernelModules = [ "kvm-amd" "sg" ]; extraModulePackages = [ ]; supportedFilesystems = [ "btrfs" ]; kernelParams = [ "ip=dhcp" ]; diff --git a/machines/sayuri/hardware-configuration.nix b/machines/sayuri/hardware-configuration.nix index 1a8698b..ca7d98c 100644 --- a/machines/sayuri/hardware-configuration.nix +++ b/machines/sayuri/hardware-configuration.nix @@ -15,7 +15,7 @@ }; initrd = { availableKernelModules = [ "aesni_intel" "ahci" "ehci_pci" "nvme" "sd_mod" "sr_mod" "usb_storage" "usbhid" "xhci_pci" ]; - kernelModules = [ "dm-snapshot" "sg" ]; + kernelModules = [ "dm-snapshot" ]; luks.devices = { root = { name = "root"; diff --git a/users/simon/default.nix b/users/simon/default.nix index f972723..0fba2e9 100644 --- a/users/simon/default.nix +++ b/users/simon/default.nix @@ -4,6 +4,7 @@ isNormalUser = true; extraGroups = [ "adbusers" + "cdrom" "corectrl" "dialout" "keys" diff --git a/users/simon/modules/makemkv.nix b/users/simon/modules/makemkv.nix index adbb720..5495e94 100644 --- a/users/simon/modules/makemkv.nix +++ b/users/simon/modules/makemkv.nix @@ -1,6 +1,6 @@ { lib, nixosConfig, pkgs, ... }: let - # TODO: Do not hardcode /dev/{sr0,sg2} (right paths on sayuri) + # TODO: Do not hardcode /dev/{sr0,sg1} (right paths on fuuko) makemkv-sandbox = pkgs.writeShellScriptBin "makemkv-sandbox" /* bash */ '' set -euo pipefail mkdir -p $HOME/.MakeMKV @@ -9,25 +9,23 @@ let --proc /proc \ --dev /dev \ --unshare-all \ + --share-net \ --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/.MakeMKV $HOME/.MakeMKV \ --dev-bind-try /dev/sr0 /dev/sr0 \ - --dev-bind-try /dev/sg2 /dev/sg2 \ + --dev-bind-try /dev/sg1 /dev/sg1 \ --dev-bind-try /sys/bus/scsi /sys/bus/scsi \ --bind ''${PWD_TARGET:-$PWD} ''${PWD_TARGET:-$PWD} \ ${pkgs.unstable.makemkv}/bin/makemkv ''; in -lib.mkIf (nixosConfig.sbruder.gui.enable && nixosConfig.sbruder.unfree.allowSoftware) { - home.packages = [ +lib.mkIf ((nixosConfig.sbruder.gui.enable || nixosConfig.networking.hostName == "fuuko") && nixosConfig.sbruder.unfree.allowSoftware) { + home.packages = with pkgs; [ makemkv-sandbox + waypipe ]; }