From 62ce6b0f45b590dae9eeecef34ff42697d132b29 Mon Sep 17 00:00:00 2001 From: s-prechtl Date: Wed, 10 Sep 2025 14:31:52 +0200 Subject: [PATCH] feat: intel encoding or so lololo --- flake.lock | 63 ++++++++++++++-------------- flake.nix | 2 +- hosts/saberofxebec/configuration.nix | 3 ++ hosts/saberofxebec/intel.nix | 11 +++++ hosts/saberofxebec/nvidia.nix | 51 ++++++++++++++++++++++ 5 files changed, 98 insertions(+), 32 deletions(-) create mode 100644 hosts/saberofxebec/intel.nix create mode 100644 hosts/saberofxebec/nvidia.nix diff --git a/flake.lock b/flake.lock index 1fd89bb..6987288 100644 --- a/flake.lock +++ b/flake.lock @@ -40,16 +40,16 @@ "brew-src": { "flake": false, "locked": { - "lastModified": 1753461463, - "narHash": "sha256-kGc7pRH0diLzKmOHsEFA8sZ9NJpgT+tqxAMsuqNd5Po=", + "lastModified": 1756059815, + "narHash": "sha256-UALOxoXoFIHbwKzcqbqCAqw5cC0MJEehLaWSet5vxfE=", "owner": "Homebrew", "repo": "brew", - "rev": "4d14be89e99a45181c18e96a5f19a5b43343cc0f", + "rev": "02947ea4edbdef5fcce9ee57fa289547f4d096c9", "type": "github" }, "original": { "owner": "Homebrew", - "ref": "4.5.13", + "ref": "4.6.7", "repo": "brew", "type": "github" } @@ -199,15 +199,16 @@ ] }, "locked": { - "lastModified": 1756991914, - "narHash": "sha256-4ve/3ah5H/SpL2m3qmZ9GU+VinQYp2MN1G7GamimTds=", + "lastModified": 1756679287, + "narHash": "sha256-Xd1vOeY9ccDf5VtVK12yM0FS6qqvfUop8UQlxEB+gTQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "b08f8737776f10920c330657bee8b95834b7a70f", + "rev": "07fc025fe10487dd80f2ec694f1cd790e752d0e8", "type": "github" }, "original": { "owner": "nix-community", + "ref": "release-25.05", "repo": "home-manager", "type": "github" } @@ -219,11 +220,11 @@ ] }, "locked": { - "lastModified": 1754613544, - "narHash": "sha256-ueR1mGX4I4DWfDRRxxMphbKDNisDeMPMusN72VV1+cc=", + "lastModified": 1756991914, + "narHash": "sha256-4ve/3ah5H/SpL2m3qmZ9GU+VinQYp2MN1G7GamimTds=", "owner": "nix-community", "repo": "home-manager", - "rev": "cc2fa2331aebf9661d22bb507d362b39852ac73f", + "rev": "b08f8737776f10920c330657bee8b95834b7a70f", "type": "github" }, "original": { @@ -317,11 +318,11 @@ ] }, "locked": { - "lastModified": 1751313918, - "narHash": "sha256-HsJM3XLa43WpG+665aGEh8iS8AfEwOIQWk3Mke3e7nk=", + "lastModified": 1755825449, + "narHash": "sha256-XkiN4NM9Xdy59h69Pc+Vg4PxkSm9EWl6u7k6D5FZ5cM=", "owner": "nix-darwin", "repo": "nix-darwin", - "rev": "e04a388232d9a6ba56967ce5b53a8a6f713cdfcf", + "rev": "8df64f819698c1fee0c2969696f54a843b2231e8", "type": "github" }, "original": { @@ -336,11 +337,11 @@ "brew-src": "brew-src" }, "locked": { - "lastModified": 1754250993, - "narHash": "sha256-MEin+qoQKtFC1b0f4tnQ+Z82BQWSCgh6Ef7rpmH9gig=", + "lastModified": 1756398546, + "narHash": "sha256-n4GVDLhKu65XFraJuCzap2AaZji4xhPaZMTJ8aQdD3s=", "owner": "zhaofengli", "repo": "nix-homebrew", - "rev": "314d057294e79bc2596972126b84c6f9f144499a", + "rev": "3aa475996cb3bc1ecefa88c99c466e6f0bc17431", "type": "github" }, "original": { @@ -351,11 +352,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1754564048, - "narHash": "sha256-dz303vGuzWjzOPOaYkS9xSW+B93PSAJxvBd6CambXVA=", + "lastModified": 1756925795, + "narHash": "sha256-kUb5hehaikfUvoJDEc7ngiieX88TwWX/bBRX9Ar6Tac=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "26ed7a0d4b8741fe1ef1ee6fa64453ca056ce113", + "rev": "ba6fab29768007e9f2657014a6e134637100c57d", "type": "github" }, "original": { @@ -415,11 +416,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1754689972, - "narHash": "sha256-eogqv6FqZXHgqrbZzHnq43GalnRbLTkbBbFtEfm1RSc=", + "lastModified": 1756886854, + "narHash": "sha256-6tooT142NLcFjt24Gi4B0G1pgWLvfw7y93sYEfSHlLI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "fc756aa6f5d3e2e5666efcf865d190701fef150a", + "rev": "0e6684e6c5755325f801bda1751a8a4038145d7d", "type": "github" }, "original": { @@ -463,11 +464,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1754498491, - "narHash": "sha256-erbiH2agUTD0Z30xcVSFcDHzkRvkRXOQ3lb887bcVrs=", + "lastModified": 1756787288, + "narHash": "sha256-rw/PHa1cqiePdBxhF66V7R+WAP8WekQ0mCDG4CFqT8Y=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c2ae88e026f9525daf89587f3cbee584b92b6134", + "rev": "d0fc30899600b9b3466ddb260fd83deb486c32f1", "type": "github" }, "original": { @@ -495,11 +496,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1752480373, - "narHash": "sha256-JHQbm+OcGp32wAsXTE/FLYGNpb+4GLi5oTvCxwSoBOA=", + "lastModified": 1755615617, + "narHash": "sha256-HMwfAJBdrr8wXAkbGhtcby1zGFvs+StOp19xNsbqdOg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "62e0f05ede1da0d54515d4ea8ce9c733f12d9f08", + "rev": "20075955deac2583bb12f07151c2df830ef346b4", "type": "github" }, "original": { @@ -568,11 +569,11 @@ "nixpkgs": "nixpkgs_6" }, "locked": { - "lastModified": 1754739276, - "narHash": "sha256-HQotJt480NsHIEgkt2ZiuvjGa50sc7cRhhsZXqZIWpU=", + "lastModified": 1756999202, + "narHash": "sha256-AiJDRmIt2DuMk2IlBPnMG52ghUI9+D1nO7JRBF2vnZ0=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "b5b7136bb6ed82504c3613a7e0cbe6f69b72e7f1", + "rev": "369fbe5c53420b1a17295c5e85ea0dbe02fbcfbd", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 53df7f2..e72ee8a 100644 --- a/flake.nix +++ b/flake.nix @@ -17,7 +17,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; home-manager-stable = { - url = "github:nix-community/home-manager"; + url = "github:nix-community/home-manager/release-25.05"; inputs.nixpkgs.follows = "nixpkgs-stable"; }; nixos-hardware.url = "github:NixOS/nixos-hardware/master"; diff --git a/hosts/saberofxebec/configuration.nix b/hosts/saberofxebec/configuration.nix index 323227f..48e7d72 100644 --- a/hosts/saberofxebec/configuration.nix +++ b/hosts/saberofxebec/configuration.nix @@ -4,6 +4,7 @@ inputs, config, pkgs, + lib, ... }: let serverIP = "192.168.0.201"; @@ -13,6 +14,8 @@ in { # Include the results of the hardware scan. ./hardware-configuration.nix ./secrets.nix + ./nvidia.nix + ./intel.nix ]; # Use the systemd-boot EFI boot loader. diff --git a/hosts/saberofxebec/intel.nix b/hosts/saberofxebec/intel.nix new file mode 100644 index 0000000..d9e8ca2 --- /dev/null +++ b/hosts/saberofxebec/intel.nix @@ -0,0 +1,11 @@ +{config, pkgs, ...}: { + services.xserver.videoDrivers = [ "modesetting" ]; + hardware.graphics = { + enable = true; + extraPackages = with pkgs; [ + intel-media-driver # Enable Hardware Acceleration + vpl-gpu-rt # Enable QSV + ]; + }; + environment.sessionVariables = { LIBVA_DRIVER_NAME = "iHD"; }; +} diff --git a/hosts/saberofxebec/nvidia.nix b/hosts/saberofxebec/nvidia.nix new file mode 100644 index 0000000..519ea57 --- /dev/null +++ b/hosts/saberofxebec/nvidia.nix @@ -0,0 +1,51 @@ +{config, lib, ...}: +{ + nixpkgs.config.allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + "nvidia-x11" + "nvidia-settings" + ]; + # 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; + + prime = { + sync.enable = true; + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:60:0:0"; + }; + + package = config.boot.kernelPackages.nvidiaPackages.stable; + }; +}