give me the must have config for mi nixos laptop, it has a moder interl cpu and a nvidia…
- User
give me the must have config for mi nixos laptop, it has a moder interl cpu and a nvidia 3080ti gpu, i want good performance, long lasting battery and of course, stability and features
- Assistant
You're looking to configure NixOS for your laptop with:
- A modern Intel CPU
- An NVIDIA 3080 Ti GPU (likely mobile/Mobile Max-Q)
- Goals: Performance, Battery life, Stability, and Features
Below is a minimal yet feature-rich, performant, and stable NixOS configuration example tailored to your hardware, with an eye toward battery life optimizations, hybrid GPU support (NVIDIA Optimus), and modern desktop conveniences.
🛠️
configuration.nix– Base SetupCreate at
/etc/nixos/configuration.nix:{ config, pkgs, lib, ... }: { nix.settings.experimental-features = [ "nix-command" "flakes" ]; ######################### # Hardware ######################### boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; # Use systemd-boot for UEFI systems boot.initrd.systemd.enable = true; boot.kernelPackages = pkgs.linuxPackages_latest; # Enable common firmware and microcode updates hardware.enableAllFirmware = true; hardware.cpu.intel.updateMicrocode = true; # NVIDIA + Intel hybrid graphics setup services.xserver.videoDrivers = [ "nvidia" ]; hardware.nvidia = { modesetting.enable = true; powerManagement.enable = true; powerManagement.finegrained = true; dynamicBoost.enable = true; prime = { sync.enable = false; offload.enable = true; intelBusId = "PCI:0:2:0"; nvidiaBusId = "PCI:1:0:0"; }; nvidiaSettings = true; open = false; # If you're on a newer kernel & card, consider `true` (open kernel module). }; ######################### # Desktop (GNOME as example) ######################### services.xserver.enable = true; services.xserver.displayManager.gdm.enable = true; services.xserver.desktopManager.gnome.enable = true; ######################### # Battery Optimization ######################### # TLP for power/thermal management services.tlp.enable = true; # CPU power saving powerManagement.cpuFreqGovernor = "powersave"; # Or "schedutil" # Thermald for thermal sensors services.thermald.enable = true; ######################### # Sound ######################### sound.enable = true; hardware.pulseaudio.enable = false; services.pipewire = { enable = true; audio.enable = true; pulse.enable = true; jack.enable = true; }; ######################### # Networking ######################### networking.networkmanager.enable = true; ######################### # Bluetooth (common for laptops) ######################### hardware.bluetooth.enable = true; services.blueman.enable = true; ######################### # System Locale + Time ######################### time.timeZone = "Europe/Amsterdam"; # Change to your zone i18n.defaultLocale = "en_US.UTF-8"; console = { font = "Lat2-Terminus16"; keyMap = "us"; }; ######################### # Users ######################### users.users.yourname = { isNormalUser = true; extraGroups = [ "wheel" "networkmanager" "audio" "video" "power" ]; shell = pkgs.zsh; }; # Enable sudo security.sudo.enable = true; ######################### # Extras ######################### programs.zsh.enable = true; programs.git.enable = true; # Enable Flatpak support for extra apps services.flatpak.enable = true; # Better font rendering fonts.fontconfig.enable = true; ######################### # Environment Packages ######################### environment.systemPackages = with pkgs; [ wget curl git zsh neovim gnome.gnome-tweaks glxinfo pciutils tlp powertop gnome.gnome-power-manager ]; system.stateVersion = "24.05"; # Always set to your installed release. }
✅ Recommended Additions
hardware-configuration.nixGenerated by NixOS installer – ensure it contains:
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "ahci" "sd_mod" "rtsx_pci" ]; boot.initrd.kernelModules = [ "i915" ]; # Intel GPU
🎮 Optional: Run Apps on NVIDIA
If you use
hardware.nvidia.prime.offload.enable = true, then Nvidia GPU apps must be launched like:__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia glxinfo | grep "OpenGL renderer"Or launch a game:
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia obsYou can alias this in your shell config.
🔌 Power Saving Tips
-
Install
powertopsudo powertop --auto-tune -
Add this service permanently:
services.powertop.enable = true; -
Consider enabling S3 sleep (if supported) in BIOS and use
mem_sleep_default:boot.kernelParams = [ "mem_sleep_default=deep" ];
🧊 Want Wayland + Hyprland?
You can use Hyprland (lightweight Wayland WM) instead of GNOME by replacing:
# Remove GNOME and GDM services.xserver.displayManager.gdm.enable = false; services.xserver.desktopManager.gnome.enable = false; # Add Hyprland programs.hyprland.enable = true;
📦 Use Nix Flakes (Recommended)
To get better reproducibility and manage configurations as code using Git.
Basic flake structure:
nix flake init -t nixos-configLet me know if you want the full flake setup.
👀 Monitoring Tools (recommended)
nvtop— monitors GPU (nvidia/intel)bpytoporbtop— nicer htop-like system monitortlpui— GUI for TLPauto-cpufreq— Dynamic CPU scaling daemon (optional)
Want to Dual Boot Windows & NixOS?
Make sure you:
- Use
boot.loader.systemd-boot.enable = true; - Leave space for Windows EFI on
/boot - Disable
Fast StartupandBitlockerin Windows - NixOS will autodetect the Windows EFI partition if
os-proberis enabled
If you'd like, I can generate a flake-based setup, hyprland configs, or optimize for gaming/emulation/dev workflows.
Let me know your needs 🙂
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.