Review/revert later

This commit is contained in:
muon 2024-07-10 21:12:56 +00:00
parent f4354da57d
commit 6bb34e1c51
13 changed files with 293 additions and 38 deletions

View file

@ -0,0 +1,112 @@
{ pkgs, lib, config, ... }: let
# steam-xinit = pkgs.writeShellScriptBin "steam-xinit" ''
# ${lib.getExe pkgs.steam}
# # exec ${lib.getExe pkgs.xterm}
# '';
stest = pkgs.writeShellScriptBin "stest" ''
socat -d TCP-LISTEN:6000,fork,bind=192.168.100.10 UNIX-CONNECT:/tmp/.X11-unix/X0 &
xhost +
ssh -X steam@192.168.100.12 steam-test-serve
'';
steam-test-serve = pkgs.writeShellScriptBin "steam-test-serve" ''
PULSE_SERVER=tcp:192.168.100.10:4713 XAUTHORITY="/home/steam/.Xauthority" DBUS_SESSION_BUS_ADDRESS="" DISPLAY=192.168.100.10:0.0 apulse steam $@
'';
in {
options.mods.containers.steam-test = {
enable = lib.mkEnableOption {
default = false;
description = "enables steam container";
};
};
config = lib.mkIf config.mods.containers.steam-test.enable {
mods.containers.enable = true;
# services.xserver.displayManager.xpra.enable = true;
environment.systemPackages = with pkgs; [
socat
stest
];
containers.stest = {
privateNetwork = true;
hostAddress = "192.168.100.10";
localAddress = "192.168.100.12";
bindMounts = {
# "/home/steam/.steam/steam/steamapps/common/SMITE" = {
# hostPath = "/mnt/bulk/SteamLibrary/steamapps/common/SMITE";
# isReadOnly = true;
# };
# "/home/steam/.steam/steam/steamapps/shadercache/386360" = {
# hostPath = "/mnt/bulk/SteamLibrary/steamapps/shadercache/386360";
# isReadOnly = true;
# };
# "/home/steam/.steam/steam/steamapps/appmanifest_386360.acf" = {
# hostPath = "/mnt/bulk/SteamLibrary/steamapps/appmanifest_386360.acf";
# isReadOnly = true;
# };
# "/home/steam/.steam/steam/steamapps/compatdata/386360/pfx/drive_c/users/steamuser/My Documents/My Games" = {
# hostPath = "/home/muon/documents/My Games";
# isReadOnly = false;
# };
# "/home/steam/.steam/steam/steamapps/appmanifest_386360.acf" = {
# hostPath = "/mnt/bulk/SteamLibrary/steamapps/appmanifest_386360.acf";
# isReadOnly = true;
# };
};
config = { config, pkgs, lib, ... }: {
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
"steam"
"steam-original"
"steam-run"
];
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
};
environment.systemPackages = with pkgs; [
xterm
glxinfo
wget
bottles
apulse
steam-test-serve
# xpra
# steam-xinit
# xorg.xinit
];
# services.xserver.enable = true;
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
# programs.ssh.forwardX11 = true;
services.openssh = {
enable = true;
# settings.X11Forwarding = true;
};
users.users.steam = {
isNormalUser = true;
extraGroups = [ "wheel" "audio" "video" ];
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKEio+Y5wBVD1wILaH2R3wV10FvVjiqy/4gGBWHOITTB muon@muon" ];
initialPassword = "changeme";
};
system.stateVersion = "23.11";
};
};
};
}