nixos-config/configurations/profile/os/games/steam.nix

138 lines
3.3 KiB
Nix
Raw Normal View History

{ config, pkgs, lib, materusArg, inputs, ... }:
2023-10-08 11:42:08 +02:00
let
optHip = pkgs.stdenv.mkDerivation rec {
2024-03-11 16:19:31 +01:00
pname = "optHip";
version = pkgs.rocmPackages.clr.version;
2023-10-08 11:42:08 +02:00
2024-03-11 16:19:31 +01:00
dontFixup = true;
dontBuild = true;
dontPatchELF = true;
dontUnpack = true;
sourceRoot = ".";
2023-10-08 11:42:08 +02:00
2024-03-11 16:19:31 +01:00
buildInputs = [
pkgs.rocmPackages.clr
];
2023-10-08 11:42:08 +02:00
2024-03-11 16:19:31 +01:00
installPhase = ''
mkdir -p $out/opt/rocm
ln -s ${pkgs.rocmPackages.clr} $out/opt/rocm/hip
'';
2023-10-08 11:42:08 +02:00
};
steamPkg = pkgs.steam.override {
extraPkgs = pkgs: [
#optHip #for blender
2023-10-14 14:40:37 +02:00
pkgs.libdecor
2023-10-08 11:42:08 +02:00
pkgs.obs-studio-plugins.obs-vkcapture
pkgs.steamcmd
pkgs.nss_latest
pkgs.libstrangle
pkgs.libkrb5
pkgs.keyutils
pkgs.libGL
pkgs.libglvnd
pkgs.gamescope
pkgs.steamPackages.steam
pkgs.libxcrypt
pkgs.gnutls
pkgs.xorg.libXcursor
pkgs.xorg.libXi
pkgs.xorg.libXinerama
pkgs.xorg.libXScrnSaver
pkgs.xorg.xinput
pkgs.xorg.xcbutilwm
pkgs.xorg.xcbutilimage
pkgs.xorg.xcbutilkeysyms
pkgs.xorg.xcbutilerrors
pkgs.xorg.xcbutilrenderutil
pkgs.xorg.xcbutil
pkgs.xorg.xwininfo
pkgs.yad
pkgs.xdotool
pkgs.libinput
pkgs.openvdb
pkgs.openssl
pkgs.tbb_2021_8
pkgs.gtk4
pkgs.gtk3
pkgs.glib
pkgs.gsettings-desktop-schemas
pkgs.fuse
pkgs.samba4Full
pkgs.tdb
pkgs.jbig2enc
pkgs.jbig2dec
pkgs.vivaldi
pkgs.x264.lib
pkgs.steamtinkerlaunch
2023-12-22 11:53:49 +01:00
pkgs.pipewire
2024-02-10 12:29:42 +01:00
pkgs.gitFull
pkgs.git-lfs
2023-10-08 11:42:08 +02:00
] ++ config.materus.profile.packages.list.fonts ++ config.materus.profile.steam.extraPkgs;
2023-10-08 11:42:08 +02:00
extraLibraries = pkgs: [
pkgs.libkrb5
pkgs.keyutils
pkgs.ncurses6
pkgs.xorg.xinput
pkgs.libinput
pkgs.fontconfig
pkgs.libxcrypt
pkgs.gnutls
2024-03-11 16:19:31 +01:00
pkgs.samba
2023-10-08 11:42:08 +02:00
pkgs.tdb
2024-02-10 12:29:42 +01:00
pkgs.jemalloc
pkgs.gperftools
2023-10-08 11:42:08 +02:00
] ++
(with config.hardware.opengl; if pkgs.hostPlatform.is64bit
then [ package ] ++ extraPackages
else [ package32 ] ++ extraPackages32);
2024-03-30 18:58:33 +01:00
extraEnv = config.materus.profile.steam.extraEnv;
2023-10-08 11:42:08 +02:00
};
cfg = config.materus.profile.steam;
in
{
options.materus.profile.steam.enable = materusArg.pkgs.lib.mkBoolOpt false "Enable materus steam settings for OS";
2023-10-08 11:42:08 +02:00
options.materus.profile.steam.package = lib.mkOption {
type = lib.types.package;
default = steamPkg;
description = "Package used by steam";
};
options.materus.profile.steam.extraPkgs = lib.mkOption {
2024-03-11 16:19:31 +01:00
default = [ ];
description = "Extra packages for steam";
};
2024-03-30 18:58:33 +01:00
options.materus.profile.steam.extraEnv = lib.mkOption {
default = { };
description = "Extra Env for steam";
};
2023-10-08 11:42:08 +02:00
config = lib.mkIf cfg.enable {
hardware.steam-hardware.enable = lib.mkDefault true;
2024-03-30 18:58:33 +01:00
materus.profile.steam.extraEnv = {
XDG_DATA_DIRS = "/usr/share:\${XDG_DATA_DIRS}";
OBS_VKCAPTURE = "1";
};
2023-10-08 11:42:08 +02:00
programs.steam = {
enable = lib.mkDefault true;
dedicatedServer.openFirewall = lib.mkDefault true;
remotePlay.openFirewall = lib.mkDefault true;
};
environment.sessionVariables = rec {
STEAM_EXTRA_COMPAT_TOOLS_PATHS = lib.mkDefault "\${HOME}/.steam/root/compatibilitytools.d";
};
environment.systemPackages = [
steamPkg
steamPkg.run
];
};
}