From 1406553af20aa82583843e53a4595642951dff1d Mon Sep 17 00:00:00 2001 From: matt1432 Date: Fri, 8 Mar 2024 16:59:41 -0500 Subject: [PATCH] fix(binto): lock nvidia driver / kernel version to working one --- devices/binto/hardware-configuration.nix | 12 +++++++++--- flake.lock | 17 +++++++++++++++++ flake.nix | 10 ++++++++++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/devices/binto/hardware-configuration.nix b/devices/binto/hardware-configuration.nix index 81be2d5a..c18920b9 100644 --- a/devices/binto/hardware-configuration.nix +++ b/devices/binto/hardware-configuration.nix @@ -2,14 +2,20 @@ config, lib, modulesPath, + nixpkgs-nvidia, pkgs, ... -}: { - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +}: let + nvidiaPkgs = import nixpkgs-nvidia { + inherit (pkgs) system; + config.allowUnfree = true; + }; +in { + nixpkgs.hostPlatform = "x86_64-linux"; imports = [(modulesPath + "/installer/scan/not-detected.nix")]; boot = { - kernelPackages = pkgs.linuxPackages_zen; + kernelPackages = nvidiaPkgs.linuxPackages_zen; kernelParams = ["amd_pstate=active"]; kernelModules = ["kvm-amd"]; diff --git a/flake.lock b/flake.lock index 07564ceb..d2dba48a 100644 --- a/flake.lock +++ b/flake.lock @@ -969,6 +969,22 @@ "type": "github" } }, + "nixpkgs-nvidia": { + "locked": { + "lastModified": 1709237383, + "narHash": "sha256-cy6ArO4k5qTx+l5o+0mL9f5fa86tYUX3ozE1S+Txlds=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1536926ef5621b09bba54035ae2bb6d806d72ac8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1536926ef5621b09bba54035ae2bb6d806d72ac8", + "type": "github" + } + }, "nixpkgs-pacemaker": { "locked": { "lastModified": 1707746079, @@ -1421,6 +1437,7 @@ "nix-melt": "nix-melt", "nix-on-droid": "nix-on-droid", "nixpkgs": "nixpkgs_4", + "nixpkgs-nvidia": "nixpkgs-nvidia", "nixpkgs-wayland": "nixpkgs-wayland", "nms": "nms", "nur": "nur", diff --git a/flake.nix b/flake.nix index 76dd1607..1dd7c5f0 100644 --- a/flake.nix +++ b/flake.nix @@ -202,6 +202,16 @@ }; # Desktop inputs + nixpkgs-nvidia = { + type = "github"; + owner = "NixOS"; + repo = "nixpkgs"; + + # This was the last commit where my nvidia drivers + # were working correctly while gaming + rev = "1536926ef5621b09bba54035ae2bb6d806d72ac8"; + }; + hyprland = { type = "github"; owner = "hyprwm";