Switch london back to nvidia

This commit is contained in:
Victor Mignot 2024-04-22 13:05:52 +02:00
parent 5724c4aa33
commit c25ab8f4de
Signed by: dala
GPG key ID: 5E7F2CE1BEAFED3D
4 changed files with 18 additions and 6 deletions

View file

@ -13,7 +13,6 @@
"usbhid" "usbhid"
]; ];
boot.initrd.kernelModules = [ "dm-snapshot" ]; boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
@ -71,7 +70,7 @@
allowUnfreePackages = true; allowUnfreePackages = true;
# Hardware acceleration # Hardware acceleration
hwAccelerationGPU = "amd"; hwAccelerationGPU = "nvidia";
keymap = "fr"; keymap = "fr";

View file

@ -26,11 +26,11 @@ with lib;
hardware.opengl = { hardware.opengl = {
enable = config.hwAccelerationGPU != null; enable = config.hwAccelerationGPU != null;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [ extraPackages = with pkgs; [
(mkIf (config.hwAccelerationGPU == "intel") intel-media-driver) (mkIf (config.hwAccelerationGPU == "intel") intel-media-driver)
(mkIf (config.hwAccelerationGPU == "intel") intel-compute-runtime) (mkIf (config.hwAccelerationGPU == "intel") intel-compute-runtime)
(mkIf (config.hwAccelerationGPU == "nvidia") libvdpau-va-gl)
(mkIf (config.hwAccelerationGPU == "nvidia") vaapiVdpau)
(mkIf (config.hwAccelerationGPU == "nvidia") vulkan-validation-layers) (mkIf (config.hwAccelerationGPU == "nvidia") vulkan-validation-layers)
(mkIf (config.hwAccelerationGPU == "nvidia") vulkan-headers) (mkIf (config.hwAccelerationGPU == "nvidia") vulkan-headers)
(mkIf (config.hwAccelerationGPU == "nvidia") vulkan-caps-viewer) (mkIf (config.hwAccelerationGPU == "nvidia") vulkan-caps-viewer)
@ -39,6 +39,12 @@ with lib;
]; ];
}; };
services.xserver.videoDrivers = mkIf (config.hwAccelerationGPU == "nvidia") [ "nouveau" ]; services.xserver.videoDrivers = mkIf (config.hwAccelerationGPU == "nvidia") [ "nvidia" ];
hardware.nvidia = mkIf (config.hwAccelerationGPU == "nvidia") {
modesetting.enable = true;
open = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
}; };
} }

View file

@ -9,6 +9,7 @@
with lib; with lib;
let let
isQwerty = keymap == "us"; isQwerty = keymap == "us";
wlrRendererLine = if nvidiaGPU then "export WLR_RENDERER=vulkan" else "";
gnomeSchema = "org.gnome.desktop.interface"; gnomeSchema = "org.gnome.desktop.interface";
monitorModule = types.submodule { monitorModule = types.submodule {
options = { options = {
@ -26,7 +27,9 @@ in
config.wayland.windowManager.sway = mkIf config.desktop.enableSwayStack { config.wayland.windowManager.sway = mkIf config.desktop.enableSwayStack {
enable = true; enable = true;
package = null;
systemd.enable = false; systemd.enable = false;
checkConfig = false;
config = rec { config = rec {
modifier = "Mod4"; modifier = "Mod4";

View file

@ -2,8 +2,12 @@
lib, lib,
pkgs, pkgs,
config, config,
nvidiaGPU,
... ...
}: }:
let
unsupportedGPUFlag = if nvidiaGPU then "--unsupported-gpu" else "";
in
with lib; with lib;
{ {
options.enableFishShell = mkOption { type = types.bool; }; options.enableFishShell = mkOption { type = types.bool; };
@ -27,7 +31,7 @@ with lib;
shellInit = '' shellInit = ''
set -g theme_color_scheme nord set -g theme_color_scheme nord
if [ -z $DISPLAY ] && [ "$(tty)" = /dev/tty1 ] if [ -z $DISPLAY ] && [ "$(tty)" = /dev/tty1 ]
exec ${pkgs.sway}/bin/.sway-wrapped exec ${pkgs.sway}/bin/.sway-wrapped ${unsupportedGPUFlag}
end end
''; '';
}; };