local shared steam installation library
fair warning: ive not been able to test this yet, i will be able to do so sometimes this summer :3
if you try this, please tell me if it didnt work
on windows steam installs games in a shared folder in programfiles/data, this does not happen, since steam on linux runs entierly inside your own user folder. this is good design, however its kinda bad when 2 users on the same linux machine wants to download the same large game
on linux the short solution is creating a folder owned by a special group, for example a group called steam, then both users sets itself inside of steam settings
the issue then is permissions. if one user creates a folder, the other may not be able to use it.
so i tried my best to make a nixos config that sets up the folders and permissions to make sure one user does not lock out the other user from editing the installs
the config uses a separate steam user, to simplify the creation of the folder and group, totally uneccecary, you could do this yourself…
{ pkgs, ... }:
{
# Group to give to users to access shared storage
users.groups."steam" = {};
# User to own the folder, and automatically create it
users.users."steam" = {
description = "Steam Shared Library User";
group = "steam";
home = "/home/steam/";
createHome = true;
homeMode = "770"; # Group may read/write and execute
isSystemUser = true;
};
}
then we also manually have to set some flags to force new files and folders to inherit permissions
# Run this inside /home/steam
# See flags
getfacl .
# Set the setgid (aka use parent group)
chmod g+s .
# Set default permissions
setfacl -d -m g::rwx
setfacl -d -m o::0