From aa2f41d14059413a5946e56acd0702a4124b5550 Mon Sep 17 00:00:00 2001 From: Aria Nolan Date: Thu, 23 Nov 2023 12:21:10 -0500 Subject: [PATCH] setup nvidia-offload --- flake.nix | 1 - hosts/JWST/configuration.nix | 40 ++++++++++++++++++------------- users/tacocat/wayland/default.nix | 8 +++++++ 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/flake.nix b/flake.nix index 448ce4c..2471594 100644 --- a/flake.nix +++ b/flake.nix @@ -65,7 +65,6 @@ ./hosts/JWST/configuration.nix sops-nix.nixosModules.sops nixos-hardware.nixosModules.dell-xps-15-9520 - nixos-hardware.nixosModules.common-gpu-nvidia-disable {nixpkgs.overlays = overlays;} home-manager.nixosModules.home-manager { diff --git a/hosts/JWST/configuration.nix b/hosts/JWST/configuration.nix index 721505b..9f740ad 100644 --- a/hosts/JWST/configuration.nix +++ b/hosts/JWST/configuration.nix @@ -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, lib, @@ -58,8 +55,6 @@ # Enable CUPS to print documents. services.printing.enable = true; services.geoclue2.enable = true; - # services.tlp.enable = true; - # services.thermald.enable = true; # Enable sound. sound.enable = true; @@ -72,22 +67,42 @@ xdg.portal = { enable = true; - # wlr.enable = true; + wlr.enable = true; extraPortals = with pkgs; [ - # xdg-desktop-portal-wlr xdg-desktop-portal-gtk ]; }; hardware.opengl = { enable = true; + driSupport = true; driSupport32Bit = true; extraPackages = with pkgs; [ 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.bluetooth.enable = true; + services.blueman.enable = true; # Define a user account. Don't forget to set a password with ‘passwd’. users.users.tacocat = { @@ -113,6 +128,8 @@ "steam" "steam-original" "steam-run" + "nvidia-x11" + "nvidia-settings" ]; environment = { @@ -127,15 +144,6 @@ rsync 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 diff --git a/users/tacocat/wayland/default.nix b/users/tacocat/wayland/default.nix index f0f5383..4f41fac 100644 --- a/users/tacocat/wayland/default.nix +++ b/users/tacocat/wayland/default.nix @@ -19,5 +19,13 @@ 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; }