harware/graphics: add nvidia and rename to gpu
Some checks are pending
/ Build Nix targets (push) Waiting to run

This commit is contained in:
Felix Buehler 2026-04-03 17:02:38 +02:00
parent 2a44b8e852
commit 7909067dc7
4 changed files with 13 additions and 20 deletions

View file

@ -2,9 +2,6 @@
pkgs, pkgs,
... ...
}: }:
let
cpuFlavor = "intel";
in
{ {
boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelPackages = pkgs.linuxPackages_latest;
@ -17,11 +14,11 @@ in
}; };
firmware = { firmware = {
enable = true; enable = true;
inherit cpuFlavor; cpuFlavor = "intel";
}; };
graphics = { graphics = {
enable = true; enable = true;
inherit cpuFlavor; gpuFlavor = "nvidia";
}; };
keychron.enable = true; keychron.enable = true;
yubikey.enable = true; yubikey.enable = true;

View file

@ -1,8 +1,4 @@
_: _: {
let
cpuFlavor = "intel";
in
{
# video driver # video driver
boot.initrd.kernelModules = [ "i915" ]; boot.initrd.kernelModules = [ "i915" ];
@ -20,11 +16,11 @@ in
drive-monitor.enable = true; drive-monitor.enable = true;
firmware = { firmware = {
enable = true; enable = true;
inherit cpuFlavor; cpuFlavor = "intel";
}; };
graphics = { graphics = {
enable = true; enable = true;
inherit cpuFlavor; gpuFlavor = "intel";
}; };
id-card.enable = true; id-card.enable = true;
keychron.enable = true; keychron.enable = true;

View file

@ -2,9 +2,6 @@
pkgs, pkgs,
... ...
}: }:
let
cpuFlavor = "amd";
in
{ {
boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelPackages = pkgs.linuxPackages_latest;
@ -30,11 +27,11 @@ in
drive-monitor.enable = true; drive-monitor.enable = true;
firmware = { firmware = {
enable = true; enable = true;
inherit cpuFlavor; cpuFlavor = "amd";
}; };
graphics = { graphics = {
enable = true; enable = true;
inherit cpuFlavor; gpuFlavor = "amd";
}; };
id-card.enable = true; id-card.enable = true;
keychron.enable = true; keychron.enable = true;

View file

@ -10,11 +10,12 @@ in
{ {
options.my.hardware.graphics = { options.my.hardware.graphics = {
enable = lib.mkEnableOption "graphics configuration"; enable = lib.mkEnableOption "graphics configuration";
cpuFlavor = lib.mkOption { gpuFlavor = lib.mkOption {
type = lib.types.nullOr ( type = lib.types.nullOr (
lib.types.enum [ lib.types.enum [
"amd" "amd"
"intel" "intel"
"nvidia"
] ]
); );
default = null; default = null;
@ -29,7 +30,7 @@ in
hardware.graphics.enable = true; hardware.graphics.enable = true;
} }
# Intel GPU # Intel GPU
(lib.mkIf (cfg.cpuFlavor == "intel") { (lib.mkIf (cfg.gpuFlavor == "intel") {
nixpkgs.config.packageOverrides = pkgs: { nixpkgs.config.packageOverrides = pkgs: {
intel-vaapi-driver = pkgs.intel-vaapi-driver.override { enableHybridCodec = true; }; intel-vaapi-driver = pkgs.intel-vaapi-driver.override { enableHybridCodec = true; };
}; };
@ -41,7 +42,9 @@ in
]; ];
}) })
(lib.mkIf (cfg.cpuFlavor == "amd") { (lib.mkIf (cfg.gpuFlavor == "amd") {
})
(lib.mkIf (cfg.gpuFlavor == "nvidia") {
}) })
] ]
); );