nvidia
This commit is contained in:
parent
42fb12b5c7
commit
46f6bb5823
|
@ -18,19 +18,21 @@
|
||||||
|
|
||||||
hardware.opengl.enable = true;
|
hardware.opengl.enable = true;
|
||||||
hardware.opengl.driSupport = true;
|
hardware.opengl.driSupport = true;
|
||||||
|
hardware.opengl.driSupport32Bit = true;
|
||||||
hardware.opengl.extraPackages = with pkgs; [
|
hardware.opengl.extraPackages = with pkgs; [
|
||||||
vaapiVdpau
|
#vaapiVdpau
|
||||||
libvdpau-va-gl
|
#libvdpau-va-gl
|
||||||
|
nvidia-vaapi-driver
|
||||||
];
|
];
|
||||||
|
|
||||||
hardware.nvidia.modesetting.enable = lib.mkDefault true; # needed for most wayland compositors
|
hardware.nvidia.modesetting.enable = lib.mkDefault true; # needed for most wayland compositors
|
||||||
hardware.nvidia.nvidiaSettings = true;
|
hardware.nvidia.nvidiaSettings = lib.mkDefault true;
|
||||||
#hardware.nvidia.open = true; # open source version of kernel module, only on driver 515.43.04+
|
#hardware.nvidia.open = lib.mkDefault true; # open source version of kernel module, only on driver 515.43.04+
|
||||||
#hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.latest; # only do this per-host
|
#hardware.nvidia.package = lib.mkDefault config.boot.kernelPackages.nvidiaPackages.latest; # only do this per-host
|
||||||
hardware.nvidia.powerManagement.enable = true; # Fix graphical corruption on suspend/resume
|
hardware.nvidia.powerManagement.enable = lib.mkDefault true; # Fix graphical corruption on suspend/resume
|
||||||
|
|
||||||
virtualisation.docker.enableNvidia = true;
|
virtualisation.docker.enableNvidia = lib.mkDefault true;
|
||||||
virtualisation.podman.enableNvidia = true;
|
virtualisation.podman.enableNvidia = lib.mkDefault true;
|
||||||
|
|
||||||
# add this to the host in question:
|
# add this to the host in question:
|
||||||
#hardware.nvidia.prime = {
|
#hardware.nvidia.prime = {
|
||||||
|
@ -61,4 +63,40 @@
|
||||||
# exec "$@"
|
# exec "$@"
|
||||||
#'')
|
#'')
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
# nvidia bad
|
||||||
|
nixpkgs.config.packageOverrides = (pkgs: {
|
||||||
|
teams = pkgs.teams.overrideAttrs (old: rec {
|
||||||
|
postInstall = (old.postInstall or "") + ''
|
||||||
|
substituteInPlace $out/share/applications/teams.desktop \
|
||||||
|
--replace 'Exec=teams' 'Exec=teams --use-gl=desktop'
|
||||||
|
'';
|
||||||
|
# --replace 'Exec=teams' 'Exec=teams --disable-gpu'
|
||||||
|
});
|
||||||
|
discord = pkgs.discord.overrideAttrs (old: rec {
|
||||||
|
desktopItem = old.desktopItem.override (old: {
|
||||||
|
#exec = "env NIXOS_OZONE_WL=1 ${old.exec}";
|
||||||
|
exec = "${old.exec} --use-gl=desktop";
|
||||||
|
});
|
||||||
|
postInstall = ''
|
||||||
|
ln -sf "${desktopItem}/share/applications" $out/share/
|
||||||
|
'' + old.postInstall;
|
||||||
|
});
|
||||||
|
slack = pkgs.slack.overrideAttrs (old: {
|
||||||
|
postInstall = old.postInstall or "" + ''
|
||||||
|
substituteInPlace $out/share/applications/slack.desktop \
|
||||||
|
--replace "$out/bin/slack " "$out/bin/slack --use-gl=desktop "
|
||||||
|
'';
|
||||||
|
# --replace "$out/bin/slack " "$out/bin/slack --disable-gpu --in-process-gpu "
|
||||||
|
});
|
||||||
|
element-desktop = pkgs.element-desktop.overrideAttrs (old: {
|
||||||
|
desktopItem = old.desktopItem.override (old: {
|
||||||
|
#exec = "env NIXOS_OZONE_WL=1 element-desktop %u";
|
||||||
|
#exec = "element-desktop --disable-gpu --in-process-gpu %u";
|
||||||
|
exec = "element-desktop --use-gl=desktop %u";
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,38 +60,6 @@
|
||||||
# TODO: remove? Move?
|
# TODO: remove? Move?
|
||||||
programs.dconf.enable = true;
|
programs.dconf.enable = true;
|
||||||
|
|
||||||
# nvidia bad
|
|
||||||
#nixpkgs.config.packageOverrides = lib.mkIf (!config.hardware.nvidia.prime.offload.enable) (pkgs: {
|
|
||||||
nixpkgs.config.packageOverrides = (pkgs: {
|
|
||||||
teams = pkgs.teams.overrideAttrs (old: rec {
|
|
||||||
postInstall = (old.postInstall or "") + ''
|
|
||||||
substituteInPlace $out/share/applications/teams.desktop \
|
|
||||||
--replace 'Exec=teams' 'Exec=teams --disable-gpu'
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
discord = pkgs.discord.overrideAttrs (old: rec {
|
|
||||||
desktopItem = old.desktopItem.override (old: {
|
|
||||||
#exec = "${pkgs.coreutils}/bin/env NIXOS_OZONE_WL=1 ${old.exec}";
|
|
||||||
exec = "${pkgs.coreutils-full}/bin/env NIXOS_OZONE_WL=1 Discord";
|
|
||||||
});
|
|
||||||
postInstall = ''
|
|
||||||
ln -sf "${desktopItem}/share/applications" $out/share/
|
|
||||||
'' + old.postInstall;
|
|
||||||
});
|
|
||||||
slack = pkgs.slack.overrideAttrs (old: {
|
|
||||||
postInstall = old.postInstall or "" + ''
|
|
||||||
substituteInPlace $out/share/applications/slack.desktop \
|
|
||||||
--replace "$out/bin/slack " "$out/bin/slack --disable-gpu --in-process-gpu "
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
element-desktop = pkgs.element-desktop.overrideAttrs (old: {
|
|
||||||
desktopItem = old.desktopItem.override (old: {
|
|
||||||
exec = "element-desktop --disable-gpu --in-process-gpu %u";
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
# Enable touchpad support (enabled default in most desktopManager).
|
# Enable touchpad support (enabled default in most desktopManager).
|
||||||
# services.xserver.libinput.enable = true;
|
# services.xserver.libinput.enable = true;
|
||||||
|
|
||||||
|
|
|
@ -102,39 +102,6 @@
|
||||||
# TODO: remove? Move?
|
# TODO: remove? Move?
|
||||||
programs.dconf.enable = true;
|
programs.dconf.enable = true;
|
||||||
|
|
||||||
# nvidia bad
|
|
||||||
#nixpkgs.config.packageOverrides = lib.mkIf (!config.hardware.nvidia.prime.offload.enable) (pkgs: {
|
|
||||||
nixpkgs.config.packageOverrides = (pkgs: {
|
|
||||||
teams = pkgs.teams.overrideAttrs (old: rec {
|
|
||||||
postInstall = (old.postInstall or "") + ''
|
|
||||||
substituteInPlace $out/share/applications/teams.desktop \
|
|
||||||
--replace 'Exec=teams' 'Exec=teams --disable-gpu'
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
discord = pkgs.discord.overrideAttrs (old: rec {
|
|
||||||
desktopItem = old.desktopItem.override (old: {
|
|
||||||
exec = "${pkgs.coreutils}/bin/env NIXOS_OZONE_WL=1 ${old.exec}";
|
|
||||||
#exec = "${pkgs.coreutils-full}/bin/env NIXOS_OZONE_WL=1 Discord";
|
|
||||||
});
|
|
||||||
postInstall = ''
|
|
||||||
ln -sf "${desktopItem}/share/applications" $out/share/
|
|
||||||
'' + old.postInstall;
|
|
||||||
});
|
|
||||||
slack = pkgs.slack.overrideAttrs (old: {
|
|
||||||
postInstall = old.postInstall or "" + ''
|
|
||||||
substituteInPlace $out/share/applications/slack.desktop \
|
|
||||||
--replace "$out/bin/slack " "$out/bin/slack --disable-gpu --in-process-gpu "
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
element-desktop = pkgs.element-desktop.overrideAttrs (old: {
|
|
||||||
desktopItem = old.desktopItem.override (old: {
|
|
||||||
exec = "element-desktop --disable-gpu --in-process-gpu %u";
|
|
||||||
#exec = "env NIXOS_OZONE_WL=1 element-desktop %u";
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
# Enable touchpad support (enabled default in most desktopManager).
|
# Enable touchpad support (enabled default in most desktopManager).
|
||||||
# services.xserver.libinput.enable = true;
|
# services.xserver.libinput.enable = true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue