From 8a6d134a2cc4a57d1a19b44f6aa513ba2388bef8 Mon Sep 17 00:00:00 2001 From: ulic-youthlic Date: Tue, 24 Jun 2025 21:42:12 +0800 Subject: [PATCH] machine(Tytonidae): Refactor hardware configuration --- nixos/configurations/Tytonidae/default.nix | 11 ------ nixos/configurations/Tytonidae/hardware.nix | 37 +++++++++++---------- 2 files changed, 19 insertions(+), 29 deletions(-) diff --git a/nixos/configurations/Tytonidae/default.nix b/nixos/configurations/Tytonidae/default.nix index 8de89aa..8dcedca 100644 --- a/nixos/configurations/Tytonidae/default.nix +++ b/nixos/configurations/Tytonidae/default.nix @@ -1,5 +1,4 @@ { - lib, pkgs, inputs, ... @@ -104,16 +103,6 @@ loader.efi.canTouchEfiVariables = true; initrd.systemd.enable = true; }; - hardware.nvidia = { - modesetting.enable = true; - open = true; - prime = { - reverseSync.enable = lib.mkDefault true; - intelBusId = "PCI:0:2:0"; - nvidiaBusId = "PCI:1:0:0"; - }; - }; - nix = {settings = {system-features = ["gccarch-alderlake"];};}; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions diff --git a/nixos/configurations/Tytonidae/hardware.nix b/nixos/configurations/Tytonidae/hardware.nix index 8fd23ca..0a988ca 100644 --- a/nixos/configurations/Tytonidae/hardware.nix +++ b/nixos/configurations/Tytonidae/hardware.nix @@ -1,27 +1,28 @@ -{pkgs, ...}: { +{ + pkgs, + lib, + ... +}: { nixpkgs.config.cudaSupport = true; services = { hardware.bolt.enable = true; fstrim.enable = true; }; + nix = {settings = {system-features = ["gccarch-alderlake"];};}; hardware = { - graphics = { - extraPackages = with pkgs; [ - vaapiIntel - libva - libvdpau-va-gl - vaapiVdpau - ocl-icd - intel-ocl - intel-compute-runtime - nvidia-vaapi-driver - intel-media-driver - ]; - extraPackages32 = with pkgs.pkgsi686Linux; [ - vaapiVdpau - libvdpau-va-gl - intel-media-driver - ]; + graphics.package = pkgs.mesa_git; + intelgpu = { + driver = "xe"; + vaapiDriver = "intel-media-driver"; + }; + nvidia = { + modesetting.enable = true; + open = true; + prime = { + reverseSync.enable = lib.mkDefault true; + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + }; }; }; }