Unable to add new library folder to steam

Hi there. I am a new nixOS user, and one of the issues I’ve struggled with is trying to add a new library to Steam.

When I go to Steam → Settings → Storage → /home → Add Drive, I get a pop-up with two options:

/tmp/dumps
Let me choose another location

If I choose the latter, I get this blank screen:

image

Clicking New folder does nothing. Clicking select does nothing. Cancel closes the window, and afterwards, I get a generic error on the previous modal:

image

Also, when I first open up the settings window, I get a bunch of spam in stdout:

Couldn't write /nix/.steam_exec_test.sh: Read-only file system
Couldn't write /nix/store/.steam_exec_test.sh: Read-only file system
Couldn't write /nix/store/9y8pmvk8gdwwznmkzxa6pwyah52xy3nk-glibc-2.38-27/etc/rpc/.steam_exec_test.sh: Not a directory
Couldn't write /nix/store/g3fisxkmyipgr4d1xyg6v1xcwfln04g4-glibc-2.38-27/etc/rpc/.steam_exec_test.sh: Not a directory
Couldn't write /usr/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/bash_completion.d/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/cups/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/dbus-1/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/debuginfod/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/gconf/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/gtk-2.0/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/gtk-3.0/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/locale/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/login.defs/.steam_exec_test.sh: Not a directory
Couldn't write /etc/man/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/mono/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/OpenCL/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/pam.d/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/pkgconfig/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/profile/.steam_exec_test.sh: Not a directory
Couldn't write /etc/profile.d/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/protocols/.steam_exec_test.sh: Not a directory
Couldn't write /etc/rpc/.steam_exec_test.sh: Not a directory
Couldn't write /etc/services/.steam_exec_test.sh: Not a directory
Couldn't write /etc/systemd/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/udev/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/vdpau_wrapper.cfg/.steam_exec_test.sh: Not a directory
Couldn't write /etc/X11/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/xattr.conf/.steam_exec_test.sh: Not a directory
Couldn't write /etc/xdg/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/xinetd.d/.steam_exec_test.sh: Read-only file system
Couldn't write /.host-etc/.steam_exec_test.sh: Read-only file system
Couldn't write /boot/.steam_exec_test.sh: Permission denied
Couldn't write /root/.steam_exec_test.sh: Permission denied
Couldn't write /srv/.steam_exec_test.sh: Permission denied
Couldn't write /var/.steam_exec_test.sh: Permission denied
Couldn't write /tmp/.X11-unix/X0/.steam_exec_test.sh: Not a directory
Couldn't write /nix/.steam_exec_test.sh: Read-only file system
Couldn't write /nix/store/.steam_exec_test.sh: Read-only file system
Couldn't write /nix/store/9y8pmvk8gdwwznmkzxa6pwyah52xy3nk-glibc-2.38-27/etc/rpc/.steam_exec_test.sh: Not a directory
Couldn't write /nix/store/g3fisxkmyipgr4d1xyg6v1xcwfln04g4-glibc-2.38-27/etc/rpc/.steam_exec_test.sh: Not a directory
Couldn't write /usr/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/bash_completion.d/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/cups/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/dbus-1/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/debuginfod/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/gconf/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/gtk-2.0/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/gtk-3.0/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/locale/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/login.defs/.steam_exec_test.sh: Not a directory
Couldn't write /etc/man/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/mono/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/OpenCL/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/pam.d/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/pkgconfig/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/profile/.steam_exec_test.sh: Not a directory
Couldn't write /etc/profile.d/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/protocols/.steam_exec_test.sh: Not a directory
Couldn't write /etc/rpc/.steam_exec_test.sh: Not a directory
Couldn't write /etc/services/.steam_exec_test.sh: Not a directory
Couldn't write /etc/systemd/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/udev/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/vdpau_wrapper.cfg/.steam_exec_test.sh: Not a directory
Couldn't write /etc/X11/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/xattr.conf/.steam_exec_test.sh: Not a directory
Couldn't write /etc/xdg/.steam_exec_test.sh: Read-only file system
Couldn't write /etc/xinetd.d/.steam_exec_test.sh: Read-only file system
Couldn't write /.host-etc/.steam_exec_test.sh: Read-only file system
Couldn't write /boot/.steam_exec_test.sh: Permission denied
Couldn't write /root/.steam_exec_test.sh: Permission denied
Couldn't write /srv/.steam_exec_test.sh: Permission denied
Couldn't write /var/.steam_exec_test.sh: Permission denied
Couldn't write /tmp/.X11-unix/X0/.steam_exec_test.sh: Not a directory

Here’s a link to my dotfiles: GitHub - rykugur/dotfiles: Various linux dotfiles.

And the relevant steam config in my dotfiles:

{ inputs, config, lib, pkgs, ... }: {
  programs = {
    steam = {
      enable = true;
      remotePlay.openFirewall = true;
      dedicatedServer.openFirewall = true;
    };
  };

  environment.systemPackages = [
    pkgs.gamescope
    pkgs.gamemode
  ];
}

I run btrfs, and have several SSD’s added under a single logical volume. Is there a way/how can I go about overriding the nixOS FHS to specify a btrfs subvolume I’ve created at /home/dusty/games? Does the subvolume perhaps need to be at the root-level (i.e. /games)? Does it need to be specified in my hardware-configuration.nix file?

What WM/DE do you run? Looks to me like your file picker menu implementatiom isn’t working for some reason, whatever it is backed by - steam will use its own if you have none.

I’m running Hyprland. I went through the wiki entry and everything looks to be installed correctly. My hyprland.nix config:

{ inputs, pkgs, ... }: {
  programs.hyprland = {
    enable = true;
    package = inputs.hyprland.packages.${pkgs.system}.hyprland;
    xwayland.enable = true;
  };

  environment.systemPackages = with pkgs; [
    xdg-desktop-portal-hyprland
    xdg-desktop-portal-gtk
  ];
}

I tested the file picker in other apps and it seems okay, but maybe that doesn’t tell me much.

EDIT: I tried adding xdg-desktop-portal as well after reading the Arch linux wiki, but no fix.

I stumbled on a github post and looks like the backend is showing true for xdg-desktop-portal-gtk portal, but reporting an error:

EDIT:

Also this line looks interesting:

        "org.freedesktop.portal.FileChooser" : {
          "available" : false
        }, 

This is not how you install portals. You use xdg.portal.enable = true; and then set xdg.portal.extraPortals, see Flatpak section of the NixOS manual.

Although you should not need it as Hyprland NixOS module does it for you:

Looking at Hyprland portal configuration, you might benefit from adding x-d-p-gtk there:

$ cat $(nix-build -A hyprland)/share/xdg-desktop-portal/hyprland-portals.conf
[preferred]
default=hyprland;gtk

The Hyprland portal enabled by default does not actually ship FileChooser portal:

$ cat $(nix-build -A xdg-desktop-portal-hyprland)/share/xdg-desktop-portal/portals/hyprland.portal
[portal]
DBusName=org.freedesktop.impl.portal.desktop.hyprland
Interfaces=org.freedesktop.impl.portal.Screenshot;org.freedesktop.impl.portal.ScreenCast;org.freedesktop.impl.portal.GlobalShortcuts;
UseIn=wlroots;Hyprland;sway;Wayfire;river;

You’re right, I was reading up on that when I saw your response.

This is specified in the Hyprland wiki, so I tried adding xdg-desktop-portal-gtk to extraPortals:

{ inputs, pkgs, ... }: {
  programs.hyprland = {
    enable = true;
    package = inputs.hyprland.packages.${pkgs.system}.hyprland;
    xwayland.enable = true;
  };

  xdg.portal = {
    enable = true;
    extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
  };
}

Unfortunately it did not fix the problem.

Have you tried running without xdpgtk? As I mentioned, steam inplements its own file chooser, which IME runs when no other chooser is installed.

You could perhaps confirm my suspicion about xdp issues by trying to pick a folder and then looking at the user log for all the xdp units you’re using. One of them should complain about not being able to do something.

Worst case, I think journalctl --user -f should give some insights anyway.

I’d need to find the post, but I read on github there was a recent change (mid 2023) that either removed the Steam file browser, or changed to prefer the native file picker.

I did indeed try without xdpgtk and no change. journalctl had this for output, which I didn’t find surprising:

Jan 28 13:38:01 jezrien dbus-daemon[1741]: [session uid=1000 pid=1741] Activating via systemd: service name='org.freedesktop.impl.portal.desktop.gtk' unit='xdg-desktop-portal-gtk.service' requested by ':1.258' (uid=1000 pid=111228 comm="/usr/libexec/steam-runtime-tools-0/x86_64-linux-gn" label="kernel")
Jan 28 13:38:01 jezrien dbus-daemon[1741]: [session uid=1000 pid=1741] Activation via systemd failed for unit 'xdg-desktop-portal-gtk.service': Unit xdg-desktop-portal-gtk.service not found.
Jan 28 13:38:01 jezrien dbus-daemon[1741]: [session uid=1000 pid=1741] Activating via systemd: service name='org.freedesktop.impl.portal.desktop.kde' unit='plasma-xdg-desktop-portal-kde.service' requested by ':1.258' (uid=1000 pid=111228 comm="/usr/libexec/steam-runtime-tools-0/x86_64-linux-gn" label="kernel")
Jan 28 13:38:01 jezrien dbus-daemon[1741]: [session uid=1000 pid=1741] Activation via systemd failed for unit 'plasma-xdg-desktop-portal-kde.service': Unit plasma-xdg-desktop-portal-kde.service not found.

Edit: found one of several github issues mentioning it here

Ah. Huh. It still showed up for me a week or three ago, but fair enough.

I vaguely recall NixOS’ fhs being problematic with the xdg portals. Can you try watching the logs with xdpgtk enabled?

Tried again with xdpgtk enabled - not much. Steam spit these logs out, butg they don’t look overly related:

… pre-submit edit: I had a bunch of stuff typed out, but decided to reboot before I submit. Hey, whadda ya know, it’s working now. The fix was to add xdg-desktop-portal-gtk to environment.systemPackages:

{ inputs, pkgs, ... }: {
  programs.hyprland = {
    enable = true;
    package = inputs.hyprland.packages.${pkgs.system}.hyprland;
    xwayland.enable = true;
  };

  xdg.portal = {
    enable = true;
    extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
  };

  environment.systemPackages = with pkgs; [
    xdg-desktop-portal-gtk
  ];
}

I think that I thought-without-thinking that adding it to extraPortals would also install it.

Thank you for your assistance!

It does. I think it’s more likely that you just needed to reboot after xdp-gtk was added to get steam to actually see it or such. But hey, nice that it’s fixed!

1 Like