Compare commits

...

5 Commits

Author SHA1 Message Date
ec1e3cf942
feat(hosts/orion): enable iwlwifi power save
Some checks failed
Check Formatting of Files / Check-Formatting (push) Failing after 44s
2024-08-11 16:54:30 -05:00
ff8e66729e
build(nix): update flake.lock 2024-08-11 16:54:29 -05:00
e4f1cc0362
chore(vesktop): update settings.json 2024-08-11 16:54:29 -05:00
34a6716d16
feat(hm/price): enable Nvidia PRIME offloading for Steam
We setup a custom `steam.desktop` entry for our applications that makes
Steam run on the Nvidia graphics card. As a consequence, all processes
launched by steam will likewise offload their graphical rendering to the
discrete graphics card as well.
2024-08-11 16:54:29 -05:00
3e7ea0bf7b
feat(hosts/orion): enable Nvidia GPU w/ PRIME 2024-08-11 16:54:29 -05:00
7 changed files with 337 additions and 55 deletions

30
flake.lock generated
View File

@ -217,11 +217,11 @@
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1723254317, "lastModified": 1723396183,
"narHash": "sha256-Ikeu1q/fXLHr7MM1E/P8JTSSiab22A/mzz8yQ/zBi8Q=", "narHash": "sha256-WqQLm0Omtp45mIHhqUMbdmHrX5oee78DYRZDglxxzOc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "emacs-overlay", "repo": "emacs-overlay",
"rev": "2568557a13c8437acfe70164f664c9c0e6d1bb94", "rev": "73ae2320be79ca277fa5b1c60afe0c6fd1a08519",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -543,11 +543,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1723015306, "lastModified": 1723399884,
"narHash": "sha256-jQnFEtH20/OsDPpx71ntZzGdRlpXhUENSQCGTjn//NA=", "narHash": "sha256-97wn0ihhGqfMb8WcUgzzkM/TuAxce2Gd20A8oiruju4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "b3d5ea65d88d67d4ec578ed11d4d2d51e3de525e", "rev": "086f619dd991a4d355c07837448244029fc2d9ab",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -666,11 +666,11 @@
"nixpkgs-regression": "nixpkgs-regression" "nixpkgs-regression": "nixpkgs-regression"
}, },
"locked": { "locked": {
"lastModified": 1723090879, "lastModified": 1723343056,
"narHash": "sha256-1hqjl4br3MRK1pkzDrhBSxKUhdfQ/P4b5KbLfGua64g=", "narHash": "sha256-ixvBNplVIqUqvshVi5azgPiGIFXlXDmahDcoP/guuTE=",
"owner": "nixos", "owner": "nixos",
"repo": "nix", "repo": "nix",
"rev": "cfe66dbec325d5dcb601b642bd9c149ae1353147", "rev": "18485d2d53622c6ec7beab80c77efbd49ed682e2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -751,11 +751,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1722987190, "lastModified": 1723282977,
"narHash": "sha256-68hmex5efCiM2aZlAAEcQgmFI4ZwWt8a80vOeB/5w3A=", "narHash": "sha256-oTK91aOlA/4IsjNAZGMEBz7Sq1zBS0Ltu4/nIQdYDOg=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "21cc704b5e918c5fbf4f9fff22b4ac2681706d90", "rev": "a781ff33ae258bbcfd4ed6e673860c3e923bf2cc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1111,11 +1111,11 @@
}, },
"locked": { "locked": {
"dir": "nix", "dir": "nix",
"lastModified": 1722353247, "lastModified": 1723400962,
"narHash": "sha256-pPH+IJ8pljR+PmeOdckoHvbQVfSBdStKbgXcaqdkTRk=", "narHash": "sha256-k/r7fRD5bd5E2PGqy63PBmqlvAftv8JYeSO1vfjrgbw=",
"owner": "wez", "owner": "wez",
"repo": "wezterm", "repo": "wezterm",
"rev": "56a27e93a9ee50aab50ff4d78308f9b3154b5122", "rev": "0ac1e948c5b4fb1d1dee532eba36c4669a64774e",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -28,13 +28,5 @@
]; ];
}; };
}; };
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver
intel-vaapi-driver
libvdpau
];
};
services.spice-vdagentd.enable = true; services.spice-vdagentd.enable = true;
} }

View File

@ -1,30 +1,31 @@
{ pkgs, config, ... }:
{ {
inputs, services.xserver.videoDrivers = [ "nvidia" ];
lib, environment.variables.VDPAU_DRIVER = "va_gl";
pkgs, hardware = {
... enableRedistributableFirmware = true;
}: graphics = {
enable = true;
{ extraPackages = with pkgs; [
# NOTE: Disable Nvidia GPU vpl-gpu-rt
boot.extraModprobeConfig = '' intel-media-driver
blacklist nouveau intel-vaapi-driver
options nouveau iwlwifi power_save=1 modeset=0 libvdpau-va-gl
''; nvidia-vaapi-driver
services.udev.extraRules = ''
# Remove NVIDIA USB xHCI Host Controller devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1"
# Remove NVIDIA USB Type-C UCSI devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{power/control}="auto", ATTR{remove}="1"
# Remove NVIDIA Audio devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1"
# Remove NVIDIA VGA/3D controller devices
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1"
'';
boot.blacklistedKernelModules = [
"nouveau"
"nvidia"
"nvidia_drm"
"nvidia_modeset"
]; ];
extraPackages32 = with pkgs.driversi686Linux; [ intel-vaapi-driver ];
};
nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.beta;
powerManagement.enable = true;
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
nvidiaBusId = "PCI:1:0:0";
intelBusId = "PCI:0:2:0";
};
};
};
} }

View File

@ -3,4 +3,7 @@
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
services.fstrim.enable = true; services.fstrim.enable = true;
boot.extraModprobeConfig = ''
options iwlwifi power_save=1
'';
} }

View File

@ -0,0 +1,4 @@
{ ... }:
{
home.file.".local/share/applications/steam.desktop".source = ./steam.desktop;
}

View File

@ -0,0 +1,282 @@
[Desktop Entry]
Name=Steam
Comment=Application for managing and playing games on Steam
Comment[pt_BR]=Aplicativo para jogar e gerenciar jogos no Steam
Comment[bg]=Приложение за ръководене и пускане на игри в Steam
Comment[cs]=Aplikace pro spravování a hraní her ve službě Steam
Comment[da]=Applikation til at håndtere og spille spil på Steam
Comment[nl]=Applicatie voor het beheer en het spelen van games op Steam
Comment[fi]=Steamin pelien hallintaan ja pelaamiseen tarkoitettu sovellus
Comment[fr]=Application de gestion et d'utilisation des jeux sur Steam
Comment[de]=Anwendung zum Verwalten und Spielen von Spielen auf Steam
Comment[el]=Εφαρμογή διαχείρισης παιχνιδιών στο Steam
Comment[hu]=Alkalmazás a Steames játékok futtatásához és kezeléséhez
Comment[it]=Applicazione per la gestione e l'esecuzione di giochi su Steam
Comment[ja]=Steam
Comment[ko]=Steam
Comment[no]=Program for å administrere og spille spill på Steam
Comment[pt_PT]=Aplicação para organizar e executar jogos no Steam
Comment[pl]=Aplikacja do zarządzania i uruchamiania gier na platformie Steam
Comment[ro]=Aplicație pentru administrarea și jucatul jocurilor pe Steam
Comment[ru]=Приложение для игр и управления играми в Steam
Comment[es]=Aplicación para administrar y ejecutar juegos en Steam
Comment[sv]=Ett program för att hantera samt spela spel på Steam
Comment[zh_CN]= Steam
Comment[zh_TW]= Steam
Comment[th]= Steam
Comment[tr]=Steam üzerinden oyun oynama ve düzenleme uygulaması
Comment[uk]=Програма для керування іграми та запуску ігор у Steam
Comment[vi]=ng dng đ qun lý và chơi trò chơi trên Steam
Exec=nvidia-offload steam %U
Icon=steam
Terminal=false
Type=Application
Categories=Network;FileTransfer;Game;
MimeType=x-scheme-handler/steam;x-scheme-handler/steamlink;
Actions=Store;Community;Library;Servers;Screenshots;News;Settings;BigPicture;Friends;
PrefersNonDefaultGPU=true
X-KDE-RunOnDiscreteGpu=true
[Desktop Action Store]
Name=Store
Name[pt_BR]=Loja
Name[bg]=Магазин
Name[cs]=Obchod
Name[da]=Butik
Name[nl]=Winkel
Name[fi]=Kauppa
Name[fr]=Magasin
Name[de]=Shop
Name[el]=ΚΑΤΑΣΤΗΜΑ
Name[hu]=Áruház
Name[it]=Negozio
Name[ja]=
Name[ko]=
Name[no]=Butikk
Name[pt_PT]=Loja
Name[pl]=Sklep
Name[ro]=Magazin
Name[ru]=Магазин
Name[es]=Tienda
Name[sv]=Butik
Name[zh_CN]=
Name[zh_TW]=
Name[th]=
Name[tr]=Mağaza
Name[uk]=Крамниця
Name[vi]=Ca hàng
Exec=nvidia-offload steam steam://store
[Desktop Action Community]
Name=Community
Name[pt_BR]=Comunidade
Name[bg]=Общност
Name[cs]=Komunita
Name[da]=Fællesskab
Name[nl]=Community
Name[fi]=Yhteisö
Name[fr]=Communauté
Name[de]=Community
Name[el]=Κοινότητα
Name[hu]=Közösség
Name[it]=Comunità
Name[ja]=
Name[ko]=
Name[no]=Samfunn
Name[pt_PT]=Comunidade
Name[pl]=Społeczność
Name[ro]=Comunitate
Name[ru]=Сообщество
Name[es]=Comunidad
Name[sv]=Gemenskap
Name[zh_CN]=
Name[zh_TW]=
Name[th]=
Name[tr]=Topluluk
Name[uk]=Спільнота
Name[vi]=Cng đng
Exec=nvidia-offload steam steam://url/SteamIDControlPage
[Desktop Action Library]
Name=Library
Name[pt_BR]=Biblioteca
Name[bg]=Библиотека
Name[cs]=Knihovna
Name[da]=Bibliotek
Name[nl]=Bibliotheek
Name[fi]=Kokoelma
Name[fr]=Bibliothèque
Name[de]=Bibliothek
Name[el]=Συλλογή
Name[hu]=Könyvtár
Name[it]=Libreria
Name[ja]=
Name[ko]=
Name[no]=Bibliotek
Name[pt_PT]=Biblioteca
Name[pl]=Biblioteka
Name[ro]=Colecţie
Name[ru]=Библиотека
Name[es]=Biblioteca
Name[sv]=Bibliotek
Name[zh_CN]=
Name[zh_TW]=
Name[th]=
Name[tr]=Kütüphane
Name[uk]=Бібліотека
Name[vi]=Thư vin
Exec=nvidia-offload steam steam://open/games
[Desktop Action Servers]
Name=Servers
Name[pt_BR]=Servidores
Name[bg]=Сървъри
Name[cs]=Servery
Name[da]=Servere
Name[nl]=Servers
Name[fi]=Palvelimet
Name[fr]=Serveurs
Name[de]=Server
Name[el]=Διακομιστές
Name[hu]=Szerverek
Name[it]=Server
Name[ja]=
Name[ko]=
Name[no]=Tjenere
Name[pt_PT]=Servidores
Name[pl]=Serwery
Name[ro]=Servere
Name[ru]=Серверы
Name[es]=Servidores
Name[sv]=Servrar
Name[zh_CN]=
Name[zh_TW]=
Name[th]=
Name[tr]=Sunucular
Name[uk]=Сервери
Name[vi]=Máy ch
Exec=nvidia-offload steam steam://open/servers
[Desktop Action Screenshots]
Name=Screenshots
Name[pt_BR]=Capturas de tela
Name[bg]=Снимки
Name[cs]=Snímky obrazovky
Name[da]=Skærmbilleder
Name[nl]=Screenshots
Name[fi]=Kuvankaappaukset
Name[fr]=Captures d'écran
Name[de]=Screenshots
Name[el]=Φωτογραφίες
Name[hu]=Képernyőmentések
Name[it]=Screenshot
Name[ja]=
Name[ko]=
Name[no]=Skjermbilder
Name[pt_PT]=Capturas de ecrã
Name[pl]=Zrzuty ekranu
Name[ro]=Capturi de ecran
Name[ru]=Скриншоты
Name[es]=Capturas
Name[sv]=Skärmdumpar
Name[zh_CN]=
Name[zh_TW]=
Name[th]=
Name[tr]=Ekran Görüntüleri
Name[uk]=Скріншоти
Name[vi]=nh chp
Exec=nvidia-offload steam steam://open/screenshots
[Desktop Action News]
Name=News
Name[pt_BR]=Notícias
Name[bg]=Новини
Name[cs]=Zprávy
Name[da]=Nyheder
Name[nl]=Nieuws
Name[fi]=Uutiset
Name[fr]=Actualités
Name[de]=Neuigkeiten
Name[el]=Νέα
Name[hu]=Hírek
Name[it]=Notizie
Name[ja]=
Name[ko]=
Name[no]=Nyheter
Name[pt_PT]=Novidades
Name[pl]=Aktualności
Name[ro]=Știri
Name[ru]=Новости
Name[es]=Noticias
Name[sv]=Nyheter
Name[zh_CN]=
Name[zh_TW]=
Name[th]=
Name[tr]=Haberler
Name[uk]=Новини
Name[vi]=Tin tc
Exec=nvidia-offload steam steam://open/news
[Desktop Action Settings]
Name=Settings
Name[pt_BR]=Configurações
Name[bg]=Настройки
Name[cs]=Nastavení
Name[da]=Indstillinger
Name[nl]=Instellingen
Name[fi]=Asetukset
Name[fr]=Paramètres
Name[de]=Einstellungen
Name[el]=Ρυθμίσεις
Name[hu]=Beállítások
Name[it]=Impostazioni
Name[ja]=
Name[ko]=
Name[no]=Innstillinger
Name[pt_PT]=Definições
Name[pl]=Ustawienia
Name[ro]=Setări
Name[ru]=Настройки
Name[es]=Parámetros
Name[sv]=Inställningar
Name[zh_CN]=
Name[zh_TW]=
Name[th]=
Name[tr]=Ayarlar
Name[uk]=Налаштування
Name[vi]=Thiết lp
Exec=nvidia-offload steam steam://open/settings
[Desktop Action BigPicture]
Name=Big Picture
Exec=nvidia-offload steam steam://open/bigpicture
[Desktop Action Friends]
Name=Friends
Name[pt_BR]=Amigos
Name[bg]=Приятели
Name[cs]=Přátelé
Name[da]=Venner
Name[nl]=Vrienden
Name[fi]=Kaverit
Name[fr]=Amis
Name[de]=Freunde
Name[el]=Φίλοι
Name[hu]=Barátok
Name[it]=Amici
Name[ja]=
Name[ko]=
Name[no]=Venner
Name[pt_PT]=Amigos
Name[pl]=Znajomi
Name[ro]=Prieteni
Name[ru]=Друзья
Name[es]=Amigos
Name[sv]=Vänner
Name[zh_CN]=
Name[zh_TW]=
Name[th]=
Name[tr]=Arkadaşlar
Name[uk]=Друзі
Name[vi]=Bn bè
Exec=nvidia-offload steam steam://open/friends

View File

@ -646,9 +646,6 @@
"VoiceMessages": { "VoiceMessages": {
"enabled": false "enabled": false
}, },
"WatchTogetherAdblock": {
"enabled": false
},
"WebKeybinds": { "WebKeybinds": {
"enabled": false "enabled": false
}, },
@ -687,6 +684,9 @@
}, },
"ShowAllRoles": { "ShowAllRoles": {
"enabled": false "enabled": false
},
"YoutubeAdblock": {
"enabled": false
} }
}, },
"notifications": { "notifications": {
@ -699,6 +699,6 @@
"authenticated": false, "authenticated": false,
"url": "https://api.vencord.dev/", "url": "https://api.vencord.dev/",
"settingsSync": false, "settingsSync": false,
"settingsSyncVersion": 1720042446162 "settingsSyncVersion": 1723406547539
} }
} }