Migrate to Snowfall (#1)
Reviewed-on: #1 Co-authored-by: Evan Reichard <evan@reichard.io> Co-committed-by: Evan Reichard <evan@reichard.io>
This commit was merged in pull request #1.
This commit is contained in:
44
modules/nixos/hardware/opengl/default.nix
Normal file
44
modules/nixos/hardware/opengl/default.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
{ config, lib, pkgs, namespace, ... }:
|
||||
let
|
||||
inherit (lib) mkIf mkForce;
|
||||
inherit (lib.${namespace}) mkBoolOpt;
|
||||
|
||||
cfg = config.${namespace}.hardware.opengl;
|
||||
in
|
||||
{
|
||||
options.${namespace}.hardware.opengl = {
|
||||
enable = lib.mkEnableOption "support for opengl";
|
||||
enable32Bit = mkBoolOpt false "enable 32-bit";
|
||||
enableIntel = mkBoolOpt false "support for intel";
|
||||
enableNvidia = mkBoolOpt false "support for nvidia";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
libva-utils
|
||||
vdpauinfo
|
||||
] ++ lib.optionals cfg.enableNvidia [
|
||||
nvtopPackages.full
|
||||
] ++ lib.optionals cfg.enableIntel [
|
||||
intel-gpu-tools
|
||||
];
|
||||
|
||||
# Add Intel Arc / Nvidia Drivers
|
||||
hardware.enableRedistributableFirmware = mkIf cfg.enableIntel (mkForce true);
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
enable32Bit = cfg.enable32Bit;
|
||||
|
||||
extraPackages = with pkgs;
|
||||
lib.optionals cfg.enableIntel [
|
||||
libvdpau-va-gl
|
||||
intel-vaapi-driver
|
||||
intel-media-driver
|
||||
intel-compute-runtime
|
||||
intel-ocl
|
||||
] ++ lib.optionals cfg.enableNvidia [
|
||||
cudatoolkit
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user