make nvidia prime configurable via modules
This commit is contained in:
parent
ef69b2f414
commit
26620cc535
2 changed files with 24 additions and 6 deletions
|
@ -56,7 +56,14 @@
|
|||
};
|
||||
};
|
||||
hardware = {
|
||||
nvidia.enable = true;
|
||||
nvidia = {
|
||||
enable = true;
|
||||
prime = {
|
||||
enable = true;
|
||||
intelBusId = "PCI:0:2:0";
|
||||
nvidiaBusId = "PCI:1:0:0";
|
||||
};
|
||||
};
|
||||
intelgputools.enable = true;
|
||||
pipewire.enable = true;
|
||||
bluetooth.enable = true;
|
||||
|
|
|
@ -11,6 +11,15 @@ with lib; let
|
|||
in {
|
||||
options.modules.hardware.nvidia = {
|
||||
enable = mkEnableOption false;
|
||||
prime.enable = mkEnableOption false;
|
||||
prime.intelBusID = mkOption {
|
||||
type = types.str;
|
||||
default = null;
|
||||
};
|
||||
prime.nvidiaBusId = mkOption {
|
||||
type = types.str;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
@ -38,7 +47,7 @@ in {
|
|||
nvidiaSettings = true;
|
||||
|
||||
# screen tearing fix
|
||||
# might break a few things, don't really know
|
||||
# might consume more power?? dont know, shouldnt be an issue hopefully
|
||||
forceFullCompositionPipeline = true;
|
||||
|
||||
# Package
|
||||
|
@ -47,11 +56,13 @@ in {
|
|||
# TODO(sako) ALSO add these as a cfg option
|
||||
prime = {
|
||||
offload = {
|
||||
enable = true;
|
||||
enableOffloadCmd = true;
|
||||
enable = cfg.prime;
|
||||
enableOffloadCmd = cfg.prime;
|
||||
};
|
||||
intelBusId = "PCI:0:2:0";
|
||||
nvidiaBusId = "PCI:1:0:0";
|
||||
#intelBusId = "PCI:0:2:0";
|
||||
#nvidiaBusId = "PCI:1:0:0";
|
||||
intelBusId = cfg.intelBusId;
|
||||
nvidiaBusId = cfg.nvidiaBusId;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue