diff --git a/system/modules/default.nix b/system/modules/default.nix index dded535..f39dc6c 100644 --- a/system/modules/default.nix +++ b/system/modules/default.nix @@ -5,6 +5,4 @@ suite-wayland = import ./suites/wayland.nix; suite-nix-channels = import ./suites/nix-channels.nix; home-manager = import ./home-manager.nix; - # hp-zbook-studio-g5 = import ./hp-zbook-studio-g5.nix; - nvidia-vulkan = import ./nvidia-vulkan.nix; } diff --git a/system/modules/hp-zbook-studio-g5.nix b/system/modules/hp-zbook-studio-g5.nix deleted file mode 100644 index a90d35a..0000000 --- a/system/modules/hp-zbook-studio-g5.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ pkgs -, config -, inputs -, ... -}: { - imports = with inputs.nixos-hardware.nixosModules; [ - # common-cpu-intel - # common-gpu-nvidia - common-pc-laptop-ssd - common-pc-laptop - ]; - - # Replacement for common-cpu-intel - # boot.initrd.kernelModules = [ "i915" ]; - # hardware.cpu.intel.updateMicrocode = config.hardware.enableRedistributableFirmware; - - # Replacement for common-gpu-nvidia - services.xserver.videoDrivers = [ "nvidia" ]; - - # Currently the stable and production versions of nvidiaPackages are crashing X11. beta does not. - hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.beta; - - # The latest nvidia versions result in 2 different backlight services. - # This interferes with brightnessctl, that increases/decreases brightness too much. - boot.kernelParams = [ - "acpi_backlight=vendor" - "video.use_native_backlight=1" - ]; - - # nixos-hardware defaults to va_gl for intel chipsets. - # This breaks on systems with nvidia. - # See https://github.com/NixOS/nixos-hardware/issues/388 - environment.variables.VDPAU_DRIVER = "nvidia"; - - hardware.nvidia.powerManagement.enable = true; - hardware.enableRedistributableFirmware = true; -} diff --git a/system/modules/mesa-vulkan-layer-nvidia.patch b/system/modules/mesa-vulkan-layer-nvidia.patch deleted file mode 100644 index b92293b..0000000 --- a/system/modules/mesa-vulkan-layer-nvidia.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff b/src/vulkan/device-select-layer/device_select_layer.c a/src/vulkan/device-select-layer/device_select_layer.c ---- b/src/vulkan/device-select-layer/device_select_layer.c -+++ a/src/vulkan/device-select-layer/device_select_layer.c -@@ -454,12 +454,8 @@ - exit(0); - } else { - unsigned selected_index = get_default_device(info, selection, physical_device_count, physical_devices); -- selected_physical_device_count = physical_device_count; -+ selected_physical_device_count = 1; - selected_physical_devices[0] = physical_devices[selected_index]; -- for (unsigned i = 0; i < physical_device_count - 1; ++i) { -- unsigned this_idx = i < selected_index ? i : i + 1; -- selected_physical_devices[i + 1] = physical_devices[this_idx]; -- } - } - - if (selected_physical_device_count == 0) { diff --git a/system/modules/nvidia-vulkan.nix b/system/modules/nvidia-vulkan.nix deleted file mode 100644 index f0e1a2f..0000000 --- a/system/modules/nvidia-vulkan.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ pkgs, config, lib, ... }: -with lib; -let - openglVulkanDrivers = mesa: - (mesa.overrideAttrs (oldAttrs: { - nativeBuildInputs = oldAttrs.nativeBuildInputs ++ [ pkgs.glslang ]; - mesonFlags = oldAttrs.mesonFlags ++ [ "-Dvulkan-layers=device-select,overlay" ]; - patches = oldAttrs.patches ++ [ ./mesa-vulkan-layer-nvidia.patch ]; - postInstall = '' - ${oldAttrs.postInstall} - - mv $out/lib/libVkLayer* $drivers/lib - - #Device Select layer - layer=VkLayer_MESA_device_select - substituteInPlace $drivers/share/vulkan/implicit_layer.d/''${layer}.json \ - --replace "lib''${layer}" "$drivers/lib/lib''${layer}" - - #Overlay layer - layer=VkLayer_MESA_overlay - substituteInPlace $drivers/share/vulkan/explicit_layer.d/''${layer}.json \ - --replace "lib''${layer}" "$drivers/lib/lib''${layer}" - ''; - })).drivers; -in -{ - options.hardware.nvidia.vulkan.enable = mkEnableOption "nvidia vulkan support"; - - config = mkIf config.hardware.nvidia.vulkan.enable { - hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.vulkan_beta; - hardware.nvidia.modesetting.enable = true; - - # Chromium cannot find libvulkan.so.1 - environment.sessionVariables.LD_LIBRARY_PATH = "${pkgs.vulkan-loader}/lib"; - - # Source: https://nixos.wiki/wiki/Mesa - hardware.opengl = - { - enable = true; - driSupport = true; - driSupport32Bit = true; - package = openglVulkanDrivers pkgs.mesa; - package32 = openglVulkanDrivers pkgs.pkgsi686Linux.mesa; - }; - }; -}