host/home: add containers for proprietary games

This commit is contained in:
Dmitriy Pleshevskiy 2024-08-22 20:30:00 +03:00
parent 2a3784696b
commit 4366a215e6
Signed by: pleshevskiy
GPG key ID: 17041163DA10A9A2
2 changed files with 24 additions and 4 deletions

View file

@ -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";
};
};
};

View file

@ -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",