From 4366a215e6b51c104ec662511a7f226efe499756 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Thu, 22 Aug 2024 20:30:00 +0300 Subject: [PATCH] host/home: add containers for proprietary games --- hosts/home/configuration.nix | 24 +++++++++++++++---- .../window-manager/xmonad/xmonad_config.hs | 4 ++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/hosts/home/configuration.nix b/hosts/home/configuration.nix index 1052116..3b763be 100644 --- a/hosts/home/configuration.nix +++ b/hosts/home/configuration.nix @@ -54,26 +54,42 @@ bindMounts = { "${config.services.transmission.settings.download-dir}" = { }; "/tmp/.X11-unix" = { }; + "/run/opengl-driver/lib" = {}; + "/run/opengl-driver-32/lib" = {}; + "/dev/kfd" = {}; + "/dev/dri" = {}; }; config = { pkgs, ... }: { + nixpkgs.config.allowUnfree = true; system.stateVersion = "23.11"; + + users.groups.transmission = config.users.groups.transmission; users.users.john = { isNormalUser = true; home = "/home/john"; password = "hello"; - extraGroups = [ "pulse-access" ]; + extraGroups = [ "pulse-access" "transmission" ]; packages = with pkgs; [ + # wine wineWowPackages.stable winetricks - gnome.nautilus - apulse + # community edition + innoextract + fallout-ce + fallout2-ce + openmw + # tools + vim + unzip + wget ]; }; environment.sessionVariables = { DISPLAY = ":0"; + PULSE_SERVER = "tcp:127.0.0.1:4713"; + WINEPREFIX = "/home/john/.wine"; WINEARCH = "win32"; - PULSE_SERVER = "tcp:127.0.0.1:4713"; }; }; }; diff --git a/modules/home-manager/configs/window-manager/xmonad/xmonad_config.hs b/modules/home-manager/configs/window-manager/xmonad/xmonad_config.hs index 76a6870..d017781 100644 --- a/modules/home-manager/configs/window-manager/xmonad/xmonad_config.hs +++ b/modules/home-manager/configs/window-manager/xmonad/xmonad_config.hs @@ -233,10 +233,13 @@ myManageHook = manageApps anyOf :: [Query Bool] -> Query Bool anyOf = foldl (<||>) (pure False) + machine = stringProperty "WM_CLIENT_MACHINE" role = stringProperty "WM_WINDOW_ROLE" isPopup = role =? "pop-up" isPinentry = anyOf [className =? "Gcr-promter", className =? "Pinentry"] + isGameMachine = machine =? "games" + isWezterm = className =? "org.wezfurlong.wezterm" isAlacritty = className =? "Alacritty" isTerminal = anyOf [isWezterm, isAlacritty] @@ -246,6 +249,7 @@ myManageHook = manageApps composeOne [ -- apps className =? "Gimp" -?> doFloat, + isGameMachine -?> doFloat, -- general anyOf [ resource =? "desktop_window",