Team Fortress 2 crash when joining match only on nixos

Today i tried to play Team Fortress 2 with my friends after work but tf2 just crash when i click on the join match button and it starts loading. I booted into the ubuntu installation on my pc and it had no problem. How i could get TF2 working on NixOS?

Config

Blockquote
{ config, pkgs, … }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
#Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
programs.steam.enable = true;
services.flatpak.enable = true;
services.mullvad-vpn.enable = true;
programs.partition-manager.enable = true;
programs.kdeconnect.enable = true;
networking.nameservers = [ “45.90.28.97” “45.90.30.97” ];
hardware.bluetooth.enable = true; # enables support for Bluetooth
hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot
networking.hostName = “nixos”; # Define your hostname.
networking.networkmanager.enable = true;
time.timeZone = “Europe/Budapest”;
i18n.defaultLocale = “hu_HU.UTF-8”;
boot.binfmt.registrations.appimage = {
wrapInterpreterInShell = false;
interpreter = “${pkgs.appimage-run}/bin/appimage-run”;
recognitionType = “magic”;
offset = 0;
mask = ‘’\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff’‘;
magicOrExtension = ‘’\x7fELF…AI\x02’';
};
i18n.extraLocaleSettings = {
LC_ADDRESS = “hu_HU.UTF-8”;
LC_IDENTIFICATION = “hu_HU.UTF-8”;
LC_MEASUREMENT = “hu_HU.UTF-8”;
LC_MONETARY = “hu_HU.UTF-8”;
LC_NAME = “hu_HU.UTF-8”;
LC_NUMERIC = “hu_HU.UTF-8”;
LC_PAPER = “hu_HU.UTF-8”;
LC_TELEPHONE = “hu_HU.UTF-8”;
LC_TIME = “hu_HU.UTF-8”;
};
services.xserver.enable = true;
services.xserver.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma5.enable = true;
services.xserver = {
layout = “hu”;
xkbVariant = “”;
};
console.keyMap = “hu”;
services.printing.enable = true;
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
users.users.heim = {
isNormalUser = true;
description = “heim”;
extraGroups = [ “networkmanager” “wheel” ];
packages = with pkgs; [
firefox
kate
steam
beeper
mullvad-vpn
teams-for-linux
brave
spotify
gnome.gnome-disk-utility
telegram-desktop
caprine-bin
wineWowPackages.full
obs-studio
wpsoffice
vlc
upscayl
speedtest-cli
protonup-qt
(pkgs.discord.override {
# remove any overrides that you don’t want
withVencord = true;
})
# thunderbird
];
};
services.xserver.displayManager.autoLogin.enable = true;
services.xserver.displayManager.autoLogin.user = “heim”;
#Allow unfree packages
nixpkgs.config.allowUnfree = true;
networking.firewall = {
enable = true;
allowedTCPPortRanges = [
{ from = 1714; to = 1764; } # KDE Connect
];
allowedUDPPortRanges = [
{ from = 1714; to = 1764; } # KDE Connect
];
};
environment.systemPackages = [ pkgs.cifs-utils ];
fileSystems.“/run/media/heim/nas” = {
device = “//192.168.0.110/public”;
fsType = “cifs”;
options = [“credentials=/etc/nixos/smb-secrets,uid=1000,gid=100,forceuid,forcegid,x-systemd.automount,x-systemd.mount-timeout=5s”];
};
}

Please use programs.steam.enable instead of adding steam to systemPackages manually.

1 Like

That is already in my config. 11. line

Ah, it’s really hard to read that thing.

What’s the error in journalctl --user -e when you run it?

You also manually add it to users.users.heim.packages though.

The steam module prepares a slightly adjusted package to add to your systemPackages, the one added to your users’ packages will probably take priority due to PATH ordering and render that ineffective: https://github.com/NixOS/nixpkgs/blob/d65bceaee0fb1e64363f7871bc43dc1c6ecad99f/nixos/modules/programs/steam.nix#L45

So, remove steam from users.users.heim.packages and make sure you didn’t also install it with nix-env at some point. Might not fix this issue, but it’s definitely better than what you have now.

2 Likes

Will post it there when i get home.

So i should remove steam from the list of packages then collect garbage?

Garbage collection shouldn’t be necessary, just rebuild and switch after you remove it.

2 Likes

heim@nixos:~]$ journalctl --user -e
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientUtils::GetLauncherType : 1
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientUtils::CheckFileSignature : 1
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientUtils::SetAPICallResultWithou>
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientUtils::AllocPendingAPICallHan>
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientUtils::GetAPICallResult : 139
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientUtils::IsAPICallCompleted : 1
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientUtils::GetAppID : 5979
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientUtils::GetImageRGBA : 19
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientUtils::GetImageSize : 19
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientUtils::GetIPCountry : 2
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientUtils::GetServerRealTime : 5
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientFriends::GetFriendPersonaName>
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientFriends::SetRichPresence : 56
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientFriends::RequestUserInformati>
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientFriends::GetFriendGamePlayed >
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientFriends::GetFriendByIndex : 30
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientFriends::GetFriendCount : 5
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientFriends::GetMediumFriendAvata>
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientFriends::GetFriendPersonaStat>
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientFriends::GetFriendRelationshi>
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientFriends::HasFriend : 19
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientFriends::GetPersonaName : 84
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientUser::BIsSubscribedApp : 1
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientUser::AdvertiseGame : 1
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientUser::GetSteamID : 459
dec 22 20:14:10 nixos plasmashell[29736]: Game 440 method call count for IClientUser::BLoggedOn : 5
dec 22 20:14:10 nixos plasmashell[29736]: Uploaded AppInterfaceStats to Steam
dec 22 20:14:13 nixos gameoverlayui[31697]: g_object_unref: assertion ‘G_IS_OBJECT (object)’ failed

Thank you! Now it does not crash just says that i need to reboot cuz im in an unprotected state??
edit: Nope, it started to crash again… :C Luckily every source game multiplayer works (cs:go, portal 2 co-op).

Right now TF2 for me:
native port: crash on startup
proton expermental and ge-proton: crash when spawning into a match (spectating is fine)

I will collect some log tomorrow

Okay, something’s spamming your logs. You’ll need to use -b instead and scroll down to get to the interesting logs. Alternatively, let -f run then start the game and wait till it crashes.

I don’t think the Windows version works with VAC.

It might be this bug. Here’s the workaround that I use.

2 Likes

Thank you! Did what was writted in the bug report as a workaround and it worked! I can finaly play TF2 without needing to boot into ubunutu :slight_smile:

This helps with initial problem, but I’m hitting so many more…

BTW. Why:

  1. Make sure that TF2’s launch options start with LD_PRELOAD="/usr/lib32/libtcmalloc_minimal.so:$LD_PRELOAD" %command%

uses /usr/lib32 which isn’t a thing on NixOS? Seems to work (games starts, at least), but I’m just curious.

Anyway…

I’m setting up a new system with Radeon RX 6700 XT, and after the workaround I’m able to start the native build, but all the letters in the UI are missing. Moreover, while I can attempt to join a game without the UI texts, the process crashes immediately.

The proton build starts, but crashes after attempting to join online game. However, if I quickly switch to native build, it will start automatically rejoin the previously attempted game and I can play. The letters in UI are still missing, which makes things weird, but somewhat playable.

Steam games are run with steam’s steam-runtime, which substitutes its own libraries. On NixOS this requires running in an FHS for various reasons, so steam is in a little container (using cgroups) to give it the illusion it’s on a traditional fhs system and has a /usr/lib32.

3 Likes