setup nvidia-offload

This commit is contained in:
Aria Nolan 2023-11-23 12:21:10 -05:00
parent 631c22a3b0
commit aa2f41d140
3 changed files with 32 additions and 17 deletions

View file

@ -65,7 +65,6 @@
./hosts/JWST/configuration.nix ./hosts/JWST/configuration.nix
sops-nix.nixosModules.sops sops-nix.nixosModules.sops
nixos-hardware.nixosModules.dell-xps-15-9520 nixos-hardware.nixosModules.dell-xps-15-9520
nixos-hardware.nixosModules.common-gpu-nvidia-disable
{nixpkgs.overlays = overlays;} {nixpkgs.overlays = overlays;}
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {

View file

@ -1,6 +1,3 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ {
# config, # config,
lib, lib,
@ -58,8 +55,6 @@
# Enable CUPS to print documents. # Enable CUPS to print documents.
services.printing.enable = true; services.printing.enable = true;
services.geoclue2.enable = true; services.geoclue2.enable = true;
# services.tlp.enable = true;
# services.thermald.enable = true;
# Enable sound. # Enable sound.
sound.enable = true; sound.enable = true;
@ -72,22 +67,42 @@
xdg.portal = { xdg.portal = {
enable = true; enable = true;
# wlr.enable = true; wlr.enable = true;
extraPortals = with pkgs; [ extraPortals = with pkgs; [
# xdg-desktop-portal-wlr
xdg-desktop-portal-gtk xdg-desktop-portal-gtk
]; ];
}; };
hardware.opengl = { hardware.opengl = {
enable = true; enable = true;
driSupport = true;
driSupport32Bit = true; driSupport32Bit = true;
extraPackages = with pkgs; [ extraPackages = with pkgs; [
intel-compute-runtime intel-compute-runtime
vaapiVdpau
]; ];
}; };
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
open = false;
nvidiaSettings = true;
prime = {
offload.enable = true;
offload.enableOffloadCmd = true;
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
};
services.xserver.videoDrivers = ["nvidia"];
hardware.opentabletdriver.enable = true; hardware.opentabletdriver.enable = true;
hardware.bluetooth.enable = true;
services.blueman.enable = true;
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
users.users.tacocat = { users.users.tacocat = {
@ -113,6 +128,8 @@
"steam" "steam"
"steam-original" "steam-original"
"steam-run" "steam-run"
"nvidia-x11"
"nvidia-settings"
]; ];
environment = { environment = {
@ -127,15 +144,6 @@
rsync rsync
strace strace
]; ];
# TODO configure this under sway with home-manager
variables = {
SDL_VIDEODRIVER = "wayland";
QT_QPA_PLATFORM = "wayland";
QT_WAYLAND_DISABLE_WINDOWDECORATIONS = "1";
_JAVA_AWT_WM_NONREPARENTING = "1";
MOZ_ENABLE_WAYLAND = "1";
};
}; };
# This value determines the NixOS release from which the default # This value determines the NixOS release from which the default

View file

@ -19,5 +19,13 @@
slurp slurp
]; ];
home.sessionVariables = {
SDL_VIDEODRIVER = "wayland";
QT_QPA_PLATFORM = "wayland";
QT_WAYLAND_DISABLE_WINDOWDECORATIONS = "1";
_JAVA_AWT_WM_NONREPARENTING = "1";
MOZ_ENABLE_WAYLAND = "1";
};
programs.rofi.package = pkgs.rofi-wayland; programs.rofi.package = pkgs.rofi-wayland;
} }