2024-02-28 23:17:23 +01:00
|
|
|
{ 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
|
|
|
|
# to use xbox controllers
|
|
|
|
pkgs.xboxdrv
|
|
|
|
];
|
|
|
|
|
|
|
|
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
|
|
|
|
# ---------
|
2024-06-26 03:00:17 +02:00
|
|
|
hardware.graphics.enable = true;
|
|
|
|
hardware.graphics.enable32Bit = true;
|
2024-02-28 23:17:23 +01:00
|
|
|
|
|
|
|
security.sudo.extraConfig = ''
|
|
|
|
${config.users.extraUsers.mainUser.name} ALL=(steam) NOPASSWD: ALL
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|