Created
July 20, 2025 16:11
-
-
Save ryanchapman/3c43911e3c2265367a3f4e12396139d5 to your computer and use it in GitHub Desktop.
nixos 25.05 with RTX-5090
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/nixos/configuration.nix | |
# | |
# Edit this configuration file to define what should be installed on | |
# your system. Help is available in the configuration.nix(5) man page | |
# and in the NixOS manual (accessible by running ‘nixos-help’). | |
{ config, pkgs, ... }: | |
{ | |
imports = | |
[ # Include the results of the hardware scan. | |
./hardware-configuration.nix | |
]; | |
nixpkgs.config.packageOverrides = pkgs: { | |
unstable = import <nixos-unstable> { config = config.nixpkgs.config; }; | |
}; | |
boot.kernelPackages = pkgs.unstable.linuxPackages_6_15; | |
# Bootloader. | |
boot.loader.systemd-boot.enable = true; | |
boot.loader.efi.canTouchEfiVariables = true; | |
boot.kernelParams = [ "nvidia-drm.modeset=1" ]; | |
# Load NVIDIA kernel modules but don't use for display | |
boot.kernelModules = [ "nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ]; | |
boot.extraModulePackages = [ pkgs.unstable.linuxPackages_6_15.nvidia_x11_stable_open ]; | |
# Use Intel for X11/display | |
services.xserver.videoDrivers = [ "modesetting" "nvidia" ]; # modesetting=Intel integrated graphics | |
# Enable NVIDIA drivers but don't use for display | |
hardware.nvidia = { | |
package = pkgs.unstable.linuxPackages_6_15.nvidiaPackages.stable; | |
open = true; | |
modesetting.enable = true; | |
nvidiaSettings = true; | |
}; | |
hardware.graphics = { | |
enable = true; | |
enable32Bit = true; # Replaces driSupport32Bit | |
extraPackages = with pkgs; [ | |
intel-media-driver # Intel VAAPI | |
vaapiIntel # Intel VAAPI (older) | |
]; | |
}; | |
hardware.firmware = with pkgs; [ | |
linux-firmware | |
# Add NVIDIA firmware explicitly | |
config.boot.kernelPackages.nvidiaPackages.stable.firmware or pkgs.nvidia-firmware | |
]; | |
# no hibernate/sleep | |
systemd.sleep.extraConfig = '' | |
AllowSuspend=no | |
AllowHibernation=no | |
AllowHybridSleep=no | |
AllowSuspendThenHibernate=no | |
''; | |
networking.hostName = "rtx5090"; # Define your hostname. | |
# Enable networking | |
networking.networkmanager.enable = true; | |
# Set your time zone. | |
time.timeZone = "America/Denver"; | |
# Select internationalisation properties. | |
i18n.defaultLocale = "en_US.UTF-8"; | |
i18n.extraLocaleSettings = { | |
LC_ADDRESS = "en_US.UTF-8"; | |
LC_IDENTIFICATION = "en_US.UTF-8"; | |
LC_MEASUREMENT = "en_US.UTF-8"; | |
LC_MONETARY = "en_US.UTF-8"; | |
LC_NAME = "en_US.UTF-8"; | |
LC_NUMERIC = "en_US.UTF-8"; | |
LC_PAPER = "en_US.UTF-8"; | |
LC_TELEPHONE = "en_US.UTF-8"; | |
LC_TIME = "en_US.UTF-8"; | |
}; | |
# Enable the X11 windowing system. | |
services.xserver.enable = true; | |
# Enable the GNOME Desktop Environment. | |
services.xserver.displayManager.gdm.enable = true; | |
services.xserver.desktopManager.gnome.enable = true; | |
# Configure keymap in X11 | |
services.xserver.xkb = { | |
layout = "us"; | |
variant = ""; | |
}; | |
# Enable CUPS to print documents. | |
services.printing.enable = true; | |
# Enable sound with pipewire. | |
services.pulseaudio.enable = false; | |
security.rtkit.enable = true; | |
services.pipewire = { | |
enable = true; | |
alsa.enable = true; | |
alsa.support32Bit = true; | |
pulse.enable = true; | |
# If you want to use JACK applications, uncomment this | |
#jack.enable = true; | |
# use the example session manager (no others are packaged yet so this is enabled by default, | |
# no need to redefine it in your config for now) | |
#media-session.enable = true; | |
}; | |
# Define a user account. Don't forget to set a password with ‘passwd’. | |
users.users.user1 = { | |
isNormalUser = true; | |
description = "user1"; | |
extraGroups = [ "networkmanager" "wheel" "docker" ]; | |
packages = with pkgs; [ | |
# thunderbird | |
]; | |
}; | |
# Install firefox. | |
programs.firefox.enable = true; | |
# Allow unfree packages | |
nixpkgs.config.allowUnfree = true; | |
nix.settings.experimental-features = [ "nix-command" "flakes" ]; | |
# List packages installed in system profile. To search, run: | |
# $ nix search wget | |
environment.systemPackages = with pkgs; [ | |
clinfo | |
cudatoolkit | |
hashcat | |
pkgs.unstable.linuxPackages_6_15.nvidia_x11_stable_open | |
pciutils | |
usbutils | |
vim | |
# wget | |
]; | |
environment.shellInit = '' | |
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath [ pkgs.cudatoolkit.lib pkgs.cudaPackages.cuda_nvml_dev ]}:/run/opengl-driver/lib" | |
''; | |
# List services that you want to enable: | |
# Enable the OpenSSH daemon. | |
services.openssh.enable = true; | |
# Open ports in the firewall. | |
networking.firewall.allowedTCPPorts = [ 22 ]; | |
# This value determines the NixOS release from which the default | |
# settings for stateful data, like file locations and database versions | |
# on your system were taken. It‘s perfectly fine and recommended to leave | |
# this value at the release version of the first install of this system. | |
# Before changing this value read the documentation for this option | |
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). | |
system.stateVersion = "25.05"; # Did you read the comment? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment