From f615f3bd6addd2057951ab6a6fb3f96fded3e529 Mon Sep 17 00:00:00 2001 From: m3tm3re
Date: Sat, 3 Jan 2026 09:31:59 +0100 Subject: [PATCH] nvidia fix m3-ares --- home/features/cli/default.nix | 15 +++++++++------ hosts/common/default.nix | 25 ++++++++++--------------- hosts/m3-ares/configuration.nix | 9 +++------ hosts/m3-ares/hardware.nix | 7 ++++++- hosts/m3-ares/services/default.nix | 1 + 5 files changed, 29 insertions(+), 28 deletions(-) diff --git a/home/features/cli/default.nix b/home/features/cli/default.nix index 3b59b82..f1529a7 100644 --- a/home/features/cli/default.nix +++ b/home/features/cli/default.nix @@ -1,6 +1,7 @@ { config, pkgs, + videoDrivers, ... }: { imports = [ @@ -14,7 +15,12 @@ ]; cli.stt-ptt = { enable = true; - whisperPackage = pkgs.whisper-cpp-vulkan; + whisperPackage = + if videoDrivers == ["nvidia"] + then pkgs.whisper-cpp.override {cudaSupport = true;} + else if videoDrivers == ["amdgpu"] + then pkgs.whisper-cpp-vulkan + else pkgs.whisper-cpp; model = "ggml-large-v3-turbo"; notifyTimeout = 2000; }; @@ -33,9 +39,7 @@ programs.bat = { enable = true; - config = { - theme = "universal"; - }; + config = {theme = "universal";}; themes = { universal = { src = pkgs.writeText "universal.tmTheme" '' @@ -165,8 +169,7 @@ programs.direnv = { enable = true; enableNushellIntegration = true; - nix-direnv.enable = - true; + nix-direnv.enable = true; }; programs.eza = { diff --git a/hosts/common/default.nix b/hosts/common/default.nix index 98d3752..4ef8473 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -1,11 +1,5 @@ # Common configuration for all hosts -{ - pkgs, - lib, - inputs, - outputs, - ... -}: { +{ config, pkgs, lib, inputs, outputs, ... }: { imports = [ ./extraServices ./ports.nix @@ -13,15 +7,17 @@ inputs.home-manager.nixosModules.home-manager ]; - environment.pathsToLink = [ - "/share/xdg-desktop-portal" - "/share/applications" - ]; + environment.pathsToLink = + [ "/share/xdg-desktop-portal" "/share/applications" ]; home-manager = { useUserPackages = true; - extraSpecialArgs = {inherit inputs outputs;}; + extraSpecialArgs = { + inherit inputs outputs; + videoDrivers = config.services.xserver.videoDrivers or [ ]; + }; }; + nixpkgs = { # You can add overlays here overlays = [ @@ -69,10 +65,9 @@ options = "--delete-older-than 30d"; }; optimise.automatic = true; - registry = - (lib.mapAttrs (_: flake: {inherit flake;})) + registry = (lib.mapAttrs (_: flake: { inherit flake; })) ((lib.filterAttrs (_: lib.isType "flake")) inputs); - nixPath = ["/etc/nix/path"]; + nixPath = [ "/etc/nix/path" ]; }; users.defaultUserShell = pkgs.nushell; } diff --git a/hosts/m3-ares/configuration.nix b/hosts/m3-ares/configuration.nix index 88b17ce..8d0662c 100644 --- a/hosts/m3-ares/configuration.nix +++ b/hosts/m3-ares/configuration.nix @@ -1,11 +1,7 @@ # 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, - pkgs, - ... -}: { +{pkgs, ...}: { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix @@ -13,7 +9,6 @@ specialisation = { "NVIDIA".configuration = { - boot.kernelParams = ["nvidia.NVreg_PreserveVideoMemoryAllocations=1"]; system.nixos.tags = ["NVIDIA"]; services.xserver.videoDrivers = ["nvidia"]; hardware.nvidia-container-toolkit.enable = true; @@ -31,6 +26,8 @@ options kvm_intel emulate_invalid_guest_state=0 options kvm ignore_msrs=1 ''; + boot.blacklistedKernelModules = ["nova_core"]; + # CRITICAL FIX #4: Kernel parameters to prevent nouveau from loading early networking.hostName = "m3-ares"; # Define your hostname. # warp-terminal update fix diff --git a/hosts/m3-ares/hardware.nix b/hosts/m3-ares/hardware.nix index 8ede075..24ad499 100644 --- a/hosts/m3-ares/hardware.nix +++ b/hosts/m3-ares/hardware.nix @@ -1,4 +1,8 @@ -{pkgs, ...}: { +{ + config, + pkgs, + ... +}: { hardware.nvidia = { prime = { offload.enable = false; @@ -15,6 +19,7 @@ open = false; dynamicBoost.enable = true; nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.production; }; hardware.tuxedo-drivers.enable = true; hardware.bluetooth.enable = true; diff --git a/hosts/m3-ares/services/default.nix b/hosts/m3-ares/services/default.nix index d4e9149..22d414c 100644 --- a/hosts/m3-ares/services/default.nix +++ b/hosts/m3-ares/services/default.nix @@ -33,6 +33,7 @@ userServices = true; }; }; + displayManager.gdm.enable = true; }; systemd.sleep.extraConfig = '' AllowSuspend=no