From 956f8d47d72c06572dc57cba8a6c37601cb42b7b Mon Sep 17 00:00:00 2001 From: Dea Date: Fri, 9 Jan 2026 13:26:43 -0500 Subject: [PATCH] pc added nvidia drivers --- flake.nix | 1 + hosts/sandalphon/configuration.nix | 28 ++++++++++++- hosts/sandalphon/hardware-configuration.nix | 44 ++++++++++++++------- 3 files changed, 57 insertions(+), 16 deletions(-) diff --git a/flake.nix b/flake.nix index d1d6c30..66d3be0 100644 --- a/flake.nix +++ b/flake.nix @@ -36,6 +36,7 @@ specialArgs = { inherit inputs; }; modules = [ ./hosts/sandalphon/hardware-configuration.nix + ./hosts/sandalphon/configuration.nix ] ++ commonModules; }; diff --git a/hosts/sandalphon/configuration.nix b/hosts/sandalphon/configuration.nix index d705620..8b3bc61 100644 --- a/hosts/sandalphon/configuration.nix +++ b/hosts/sandalphon/configuration.nix @@ -1,12 +1,36 @@ { + lib, + inputs, pkgs, ... }: { - networking.hostName = "sandalphon"; + networking.hostName = lib.mkDefault "sandalphon"; + + # nvidia drivers + hardware.graphics = { + enable = true; + }; + services.xserver.videoDrivers = [ "nvidia" ]; + hardware.nvidia = { + modesetting.enable = true; + # Nvidia power management. Experimental, and can cause sleep/suspend to fail. + # Enable this if you have graphical corruption issues or application crashes after waking + # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead + # of just the bare essentials. + powerManagement.enable = false; + + powerManagement.finegrained = false; + open = true; + # Enable the Nvidia settings menu, + # accessible via `nvidia-settings`. + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; environment.systemPackages = with pkgs; [ - prismlauncher + prismlauncher # minecraft + waywall # mcsr ]; } diff --git a/hosts/sandalphon/hardware-configuration.nix b/hosts/sandalphon/hardware-configuration.nix index 072961b..57f1699 100644 --- a/hosts/sandalphon/hardware-configuration.nix +++ b/hosts/sandalphon/hardware-configuration.nix @@ -1,28 +1,44 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usbhid" + "usb_storage" + "sd_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/f66916c1-a834-4fb4-9ded-ee04d3650baf"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/f66916c1-a834-4fb4-9ded-ee04d3650baf"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/E474-7CAD"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/E474-7CAD"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; swapDevices = [ ];