nixos-config/components/gui/steam.nix
Ingolf Wagner 2c95eb5946
All checks were successful
Build all NixOS Configurations / nix build (push) Successful in 9m47s
🐛 fix nix flake update
2025-01-02 22:15:11 +13:00

48 lines
988 B
Nix

{
config,
pkgs,
lib,
...
}:
with lib;
{
options.components.gui.steam.enable = mkOption {
type = lib.types.bool;
default = config.components.gui.enable;
};
config = mkIf (config.components.gui.steam.enable) {
environment.systemPackages = [
(pkgs.writeShellScriptBin "steam" ''
/var/run/wrappers/bin/sudo -u steam -i ${pkgs.steam}/bin/steam $@
'')
pkgs.xorg.xhost
];
users.users.steam = {
isNormalUser = false;
isSystemUser = true;
home = "/home/steam";
createHome = true;
extraGroups = [
"audio"
"input"
"video"
"pipewire"
];
group = "steam";
shell = pkgs.bashInteractive;
};
users.groups.steam = { };
# for steam
# ---------
hardware.graphics.enable = true;
hardware.graphics.enable32Bit = true;
security.sudo.extraConfig = ''
${config.users.extraUsers.mainUser.name} ALL=(steam) NOPASSWD: ALL
'';
};
}