mirror of
https://github.com/Stunkymonkey/nixos.git
synced 2026-04-27 07:48:44 +02:00
harware/graphics: add nvidia and rename to gpu
Some checks are pending
/ Build Nix targets (push) Waiting to run
Some checks are pending
/ Build Nix targets (push) Waiting to run
This commit is contained in:
parent
2a44b8e852
commit
7909067dc7
4 changed files with 13 additions and 20 deletions
|
|
@ -2,9 +2,6 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cpuFlavor = "intel";
|
||||
in
|
||||
{
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
|
|
@ -17,11 +14,11 @@ in
|
|||
};
|
||||
firmware = {
|
||||
enable = true;
|
||||
inherit cpuFlavor;
|
||||
cpuFlavor = "intel";
|
||||
};
|
||||
graphics = {
|
||||
enable = true;
|
||||
inherit cpuFlavor;
|
||||
gpuFlavor = "nvidia";
|
||||
};
|
||||
keychron.enable = true;
|
||||
yubikey.enable = true;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,4 @@
|
|||
_:
|
||||
let
|
||||
cpuFlavor = "intel";
|
||||
in
|
||||
{
|
||||
_: {
|
||||
# video driver
|
||||
boot.initrd.kernelModules = [ "i915" ];
|
||||
|
||||
|
|
@ -20,11 +16,11 @@ in
|
|||
drive-monitor.enable = true;
|
||||
firmware = {
|
||||
enable = true;
|
||||
inherit cpuFlavor;
|
||||
cpuFlavor = "intel";
|
||||
};
|
||||
graphics = {
|
||||
enable = true;
|
||||
inherit cpuFlavor;
|
||||
gpuFlavor = "intel";
|
||||
};
|
||||
id-card.enable = true;
|
||||
keychron.enable = true;
|
||||
|
|
|
|||
|
|
@ -2,9 +2,6 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cpuFlavor = "amd";
|
||||
in
|
||||
{
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
|
|
@ -30,11 +27,11 @@ in
|
|||
drive-monitor.enable = true;
|
||||
firmware = {
|
||||
enable = true;
|
||||
inherit cpuFlavor;
|
||||
cpuFlavor = "amd";
|
||||
};
|
||||
graphics = {
|
||||
enable = true;
|
||||
inherit cpuFlavor;
|
||||
gpuFlavor = "amd";
|
||||
};
|
||||
id-card.enable = true;
|
||||
keychron.enable = true;
|
||||
|
|
|
|||
|
|
@ -10,11 +10,12 @@ in
|
|||
{
|
||||
options.my.hardware.graphics = {
|
||||
enable = lib.mkEnableOption "graphics configuration";
|
||||
cpuFlavor = lib.mkOption {
|
||||
gpuFlavor = lib.mkOption {
|
||||
type = lib.types.nullOr (
|
||||
lib.types.enum [
|
||||
"amd"
|
||||
"intel"
|
||||
"nvidia"
|
||||
]
|
||||
);
|
||||
default = null;
|
||||
|
|
@ -29,7 +30,7 @@ in
|
|||
hardware.graphics.enable = true;
|
||||
}
|
||||
# Intel GPU
|
||||
(lib.mkIf (cfg.cpuFlavor == "intel") {
|
||||
(lib.mkIf (cfg.gpuFlavor == "intel") {
|
||||
nixpkgs.config.packageOverrides = pkgs: {
|
||||
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") {
|
||||
})
|
||||
]
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue