software/steam: add steam module
This commit is contained in:
parent
94fa6bc2f3
commit
df5738904f
5 changed files with 63 additions and 17 deletions
|
@ -37,6 +37,9 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
btrfs.enable = true;
|
btrfs.enable = true;
|
||||||
};
|
};
|
||||||
|
software = {
|
||||||
|
steam.enable = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.interfaces = {
|
networking.interfaces = {
|
||||||
|
|
60
modules/modules/software/steam.nix
Normal file
60
modules/modules/software/steam.nix
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
with lib;
|
||||||
|
with lib.hlissner;
|
||||||
|
let
|
||||||
|
cfg = config.modules.software.steam;
|
||||||
|
|
||||||
|
hw = config.modules.hardware;
|
||||||
|
|
||||||
|
steam = pkgs.steam.override {
|
||||||
|
extraLibraries = (pkgs:
|
||||||
|
(with config.hardware.opengl;
|
||||||
|
if pkgs.hostPlatform.is64bit
|
||||||
|
then [ package ] ++ extraPackages
|
||||||
|
else [ package32 ] ++ extraPackages32)
|
||||||
|
|
||||||
|
++ (with pkgs; [ pipewire ]));
|
||||||
|
|
||||||
|
|
||||||
|
extraProfile = mkIf hw.gpu.nvidia ''
|
||||||
|
unset VK_ICD_FILENAMES
|
||||||
|
export VK_ICD_FILENAMES=${config.hardware.nvidia.package}/share/vulkan/icd.d/nvidia_icd.json:${config.hardware.nvidia.package.lib32}/share/vulkan/icd.d/nvidia_icd32.json
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.modules.software.steam = {
|
||||||
|
enable = mkBoolOpt false;
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkMerge [
|
||||||
|
{
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = cfg.enable && !config.info.graphical;
|
||||||
|
message = "Steam cannot be enabled in a non-graphical environment";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
(mkIf cfg.enable {
|
||||||
|
# Taken from the programs.steam option, reimplemented here to move software into userland
|
||||||
|
hardware.opengl = {
|
||||||
|
enable = true;
|
||||||
|
driSupport = true;
|
||||||
|
driSupport32Bit = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
hardware.pulseaudio.support32Bit = config.hardware.pulseaudio.enable;
|
||||||
|
|
||||||
|
hardware.steam-hardware.enable = true;
|
||||||
|
|
||||||
|
home.home.packages = [
|
||||||
|
steam
|
||||||
|
steam.run
|
||||||
|
|
||||||
|
pkgs.protonup
|
||||||
|
];
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
|
@ -83,8 +83,6 @@ in
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
dconf.enable = true;
|
dconf.enable = true;
|
||||||
|
|
||||||
steam.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
modules = {
|
modules = {
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
{ pkgs, ... }: {
|
{ pkgs, ... }: {
|
||||||
imports = [ ./steam.nix ];
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
wineWowPackages.stable
|
wineWowPackages.stable
|
||||||
(multimc.override { msaClientID = "01524508-0110-46fc-b468-362d31ca41e6"; })
|
(multimc.override { msaClientID = "01524508-0110-46fc-b468-362d31ca41e6"; })
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
{ pkgs, main, ... }: {
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
(steam.override {
|
|
||||||
extraLibraries = pkgs: with pkgs; [ pipewire ];
|
|
||||||
extraProfile = ''
|
|
||||||
unset VK_ICD_FILENAMES
|
|
||||||
export VK_ICD_FILENAMES=${main.hardware.nvidia.package}/share/vulkan/icd.d/nvidia_icd.json:${main.hardware.nvidia.package.lib32}/share/vulkan/icd.d/nvidia_icd32.json
|
|
||||||
'';
|
|
||||||
})
|
|
||||||
|
|
||||||
protonup
|
|
||||||
];
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue