Streamlining variables for hardware drivers

This commit is contained in:
Tyler Kelley 2024-01-23 17:43:03 -06:00
parent d88288c66e
commit c1179e4a9b
6 changed files with 25 additions and 33 deletions

View File

@ -1,6 +1,6 @@
{ pkgs, config, lib, deviceProfile, ... }:
{ pkgs, config, lib, gpuType, ... }:
lib.mkIf ("${deviceProfile}" == "amd-desktop") {
lib.mkIf ("${gpuType}" == "amd") {
# OpenGL
hardware.opengl = {
enable = true;

View File

@ -1,10 +0,0 @@
{ pkgs, config, lib, deviceProfile, ... }:
lib.mkIf ("${deviceProfile}" == "amd-desktop") {
# Steam Configuration
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
};
}

View File

@ -3,12 +3,11 @@
{
imports = [
./amd-opengl.nix
./amd-steam.nix
./steam.nix
./autorun.nix
./boot.nix
./displaymanager.nix
./intel-opengl.nix
./intel-steam.nix
./packages.nix
./polkit.nix
./services.nix

View File

@ -1,14 +0,0 @@
{ pkgs, config, lib, deviceProfile, ... }:
lib.mkIf ("${deviceProfile}" == "intel-laptop") {
# Steam Configuration
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
package = pkgs.steam.override {
withPrimus = true;
extraPkgs = pkgs: [ pkgs.bumblebee pkgs.glxinfo ];
};
};
}

16
config/system/steam.nix Normal file
View File

@ -0,0 +1,16 @@
{ pkgs, config, lib, cpuType, ... }:
{
# Steam Configuration
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
package = lib.mkIf ("${cpuType}" == "intel") {
pkgs.steam.override {
withPrimus = true;
extraPkgs = pkgs: [ pkgs.bumblebee pkgs.glxinfo ];
};
};
};
}

View File

@ -31,9 +31,10 @@
wallpaperGit = "https://gitlab.com/Zaney/my-wallpapers.git";
wallpaperDir = "/home/${username}/Pictures/Wallpapers";
flakeDir = "/home/${username}/zaneyos";
# Configuration option profile
# default options amd-desktop, intel-laptop, vm (WIP)
deviceProfile = "amd-desktop";
# Driver selection profile
# default options amd, intel, nvidia, vm (WIP)
cpuType = "amd";
gpuType = "amd";
pkgs = import nixpkgs {
inherit system;
@ -50,8 +51,8 @@
inherit gitUsername; inherit theTimezone;
inherit gitEmail; inherit theLocale;
inherit wallpaperDir; inherit wallpaperGit;
inherit deviceProfile; inherit theKBDLayout;
inherit theLCVariables;
inherit cpuType; inherit theKBDLayout;
inherit theLCVariables; inherit gpuType;
};
modules = [ ./system.nix
home-manager.nixosModules.home-manager {