Merge branch 'nvidia' into 'master'

feat(Hardware): Nvidia GPU Support

See merge request finn.markwitz/nixos!9
This commit is contained in:
2026-04-20 14:07:05 +00:00
8 changed files with 117 additions and 55 deletions
Generated
+31 -31
View File
@@ -3,15 +3,15 @@
"flake-compat": { "flake-compat": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1733328505, "lastModified": 1767039857,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
"owner": "edolstra", "owner": "NixOS",
"repo": "flake-compat", "repo": "flake-compat",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "edolstra", "owner": "NixOS",
"repo": "flake-compat", "repo": "flake-compat",
"type": "github" "type": "github"
} }
@@ -21,11 +21,11 @@
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": { "locked": {
"lastModified": 1767609335, "lastModified": 1775087534,
"narHash": "sha256-feveD98mQpptwrAEggBQKJTYbvwwglSbOv53uCfH9PY=", "narHash": "sha256-91qqW8lhL7TLwgQWijoGBbiD4t7/q75KTi8NxjVmSmA=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "250481aafeb741edfe23d29195671c19b36b6dca", "rev": "3107b77cd68437b9a76194f0f7f9c55f2329ca5b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -96,11 +96,11 @@
"nixpkgs-regression": "nixpkgs-regression" "nixpkgs-regression": "nixpkgs-regression"
}, },
"locked": { "locked": {
"lastModified": 1767819389, "lastModified": 1775298231,
"narHash": "sha256-nlxFjeUol1SGFaseQWtHZ+Ibo4Epn+E6NZKg1anTb2o=", "narHash": "sha256-mBl1H9IbI8ddKXi0B04SkC7EaAtX0xt4pqapHBm39Ag=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nix", "repo": "nix",
"rev": "5a65b1f1313dd3b1c36967a11ab998b1b20f642c", "rev": "553fb35af1bed8f8f4d2185a29a4c7ab21c0882f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -132,11 +132,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1764234087, "lastModified": 1769813415,
"narHash": "sha256-NHF7QWa0ZPT8hsJrvijREW3+nifmF2rTXgS2v0tpcEA=", "narHash": "sha256-nnVmNNKBi1YiBNPhKclNYDORoHkuKipoz7EtVnXO50A=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixos-generators", "repo": "nixos-generators",
"rev": "032a1878682fafe829edfcf5fdfad635a2efe748", "rev": "8946737ff703382fda7623b9fab071d037e897d5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -147,11 +147,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1767185284, "lastModified": 1775490113,
"narHash": "sha256-ljDBUDpD1Cg5n3mJI81Hz5qeZAwCGxon4kQW3Ho3+6Q=", "narHash": "sha256-2ZBhDNZZwYkRmefK5XLOusCJHnoeKkoN95hoSGgMxWM=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "40b1a28dce561bea34858287fbb23052c3ee63fe", "rev": "c775c2772ba56e906cbeb4e0b2db19079ef11ff7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -162,15 +162,15 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1763948260, "lastModified": 1771903837,
"narHash": "sha256-zZk7fn2ARAqmLwaYTpxBJmj81KIdz11NiWt7ydHHD/M=", "narHash": "sha256-jEA8WggGKtMFeNeCKq3NK8cLEjJmG6/RLUElYYbBZ0E=",
"rev": "1c8ba8d3f7634acac4a2094eef7c32ad9106532c", "rev": "e764fc9a405871f1f6ca3d1394fb422e0a0c3951",
"type": "tarball", "type": "tarball",
"url": "https://releases.nixos.org/nixos/25.05/nixos-25.05.813095.1c8ba8d3f763/nixexprs.tar.xz" "url": "https://releases.nixos.org/nixos/25.11/nixos-25.11.6495.e764fc9a4058/nixexprs.tar.xz"
}, },
"original": { "original": {
"type": "tarball", "type": "tarball",
"url": "https://channels.nixos.org/nixos-25.05/nixexprs.tar.xz" "url": "https://channels.nixos.org/nixos-25.11/nixexprs.tar.xz"
} }
}, },
"nixpkgs-23-11": { "nixpkgs-23-11": {
@@ -191,11 +191,11 @@
}, },
"nixpkgs-lib": { "nixpkgs-lib": {
"locked": { "locked": {
"lastModified": 1765674936, "lastModified": 1774748309,
"narHash": "sha256-k00uTP4JNfmejrCLJOwdObYC9jHRrr/5M/a/8L2EIdo=", "narHash": "sha256-+U7gF3qxzwD5TZuANzZPeJTZRHS29OFQgkQ2kiTJBIQ=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixpkgs.lib", "repo": "nixpkgs.lib",
"rev": "2075416fcb47225d9b68ac469a5c4801a9c4dd85", "rev": "333c4e0545a6da976206c74db8773a1645b5870a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -222,11 +222,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1767767207, "lastModified": 1775423009,
"narHash": "sha256-Mj3d3PfwltLmukFal5i3fFt27L6NiKXdBezC1EBuZs4=", "narHash": "sha256-vPKLpjhIVWdDrfiUM8atW6YkIggCEKdSAlJPzzhkQlw=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "5912c1772a44e31bf1c63c0390b90501e5026886", "rev": "68d8aa3d661f0e6bd5862291b5bb263b2a6595c9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -237,11 +237,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1767799921, "lastModified": 1775305101,
"narHash": "sha256-r4GVX+FToWVE2My8VVZH4V0pTIpnu2ZE8/Z4uxGEMBE=", "narHash": "sha256-/74n1oQPtKG52Yw41cbToxspxHbYz6O3vi+XEw16Qe8=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d351d0653aeb7877273920cd3e823994e7579b0b", "rev": "36a601196c4ebf49e035270e10b2d103fe39076b",
"type": "github" "type": "github"
}, },
"original": { "original": {
+16 -21
View File
@@ -20,17 +20,11 @@
useOSProber = true; useOSProber = true;
}; };
# 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 # Configure keymap in X11
services.xserver = { services.xserver.xkb = {
layout = "de"; layout = "de";
xkbVariant = ""; variant = "";
}; };
# Configure console keymap # Configure console keymap
@@ -38,21 +32,22 @@
# Enable CUPS to print documents. # Enable CUPS to print documents.
services.printing.enable = true; services.printing.enable = true;
nixpkgs.config.allowUnfree = true;
# Enable sound with pipewire.
hardware.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, hardware.nvidia.prime = {
# no need to redefine it in your config for now) sync.enable = true;
#media-session.enable = true;
nvidiaBusId = "PCI:01:00:0";
intelBusId = "PCI:00:2:0";
};
hardware.nvidia.prime = {
sync.enable = true;
nvidiaBusId = "PCI:01:00:0";
intelBusId = "PCI:00:02:0";
}; };
system = { system = {
+1 -1
View File
@@ -9,7 +9,7 @@
{ {
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/077abdb0-cbc1-4589-b411-25ecc157488f"; device = "/dev/disk/by-uuid/46e36a07-e75a-480a-a2f1-be103c6a3881";
fsType = "ext4"; fsType = "ext4";
}; };
} }
+13 -1
View File
@@ -5,11 +5,23 @@ let
in in
{ {
my.profiles = { my.profiles = {
hyprland.enable = true; kde-desktop.enable = true;
zsh.enable = true; zsh.enable = true;
apps = { apps = {
desktop_apps = true; desktop_apps = true;
dev_apps = true; dev_apps = true;
}; };
development.enable = true;
docker.enable = true;
}; };
my.hardware = {
bluetooth.enable = true;
sound.enable = false;
nvidia.enable = true;
};
my.services = {
vpn.enable = true;
};
} }
+1 -1
View File
@@ -24,7 +24,7 @@
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = { fileSystems."/" = {
device = "/dev/disk/by-uuid/077abdb0-cbc1-4589-b411-25ecc157488f"; device = "/dev/disk/by-uuid/46e36a07-e75a-480a-a2f1-be103c6a3881";
fsType = "ext4"; fsType = "ext4";
}; };
@@ -17,6 +17,7 @@ in
users.users.finn.packages = with pkgs; [ users.users.finn.packages = with pkgs; [
google-chrome google-chrome
vscode vscode
zed-editor
neovim neovim
# jetbrains.idea-ultimate # jetbrains.idea-ultimate
go go
+1
View File
@@ -9,6 +9,7 @@
#./firmware #./firmware
#./graphics #./graphics
#./keychron #./keychron
./nvidia
#./yubikey #./yubikey
./sound ./sound
#./thunderbolt #./thunderbolt
+53
View File
@@ -0,0 +1,53 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.my.hardware.nvidia;
in
{
options.my.hardware.nvidia = with lib; {
enable = mkEnableOption "NVIDIA GPU support";
};
config = lib.mkIf cfg.enable {
# Enable OpenGL
hardware.graphics = {
enable = true;
};
# Load nvidia driver for Xorg and Wayland
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
# Modesetting is required.
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;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
open = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
};
}