Initial commit
This commit is contained in:
commit
69d741b98b
29 changed files with 718 additions and 0 deletions
11
nixosModules/drivers/gpu/amd.nix
Normal file
11
nixosModules/drivers/gpu/amd.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ lib, config, ... }: {
|
||||
|
||||
options = {
|
||||
settings.drivers.gpu.amd.enable = lib.mkEnableOption "enable AMD gpu drivers";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.settings.drivers.gpu.amd.enable {
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
services.xserver.videoDrivers = [ "amdgpu" ];
|
||||
};
|
||||
}
|
||||
24
nixosModules/drivers/gpu/disableNvidia.nix
Normal file
24
nixosModules/drivers/gpu/disableNvidia.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ lib, config, ... }: {
|
||||
|
||||
options = {
|
||||
settings.drivers.gpu.nvidia.forceDisable = lib.mkEnableOption "force disable all nvidia drivers";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.settings.drivers.gpu.nvidia.forceDisable {
|
||||
boot.extraModprobeConfig = ''
|
||||
blacklist nouveau
|
||||
options nouveau modeset=0
|
||||
'';
|
||||
services.udev.extraRules = ''
|
||||
# Remove NVIDIA USB xHCI Host Controller devices, if present
|
||||
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1"
|
||||
# Remove NVIDIA USB Type-C UCSI devices, if present
|
||||
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{power/control}="auto", ATTR{remove}="1"
|
||||
# Remove NVIDIA Audio devices, if present
|
||||
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1"
|
||||
# Remove NVIDIA VGA/3D controller devices
|
||||
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1"
|
||||
'';
|
||||
boot.blacklistedKernelModules = [ "nouveau" "nvidia" "nvidia_drm" "nvidia_modeset" ];
|
||||
};
|
||||
}
|
||||
25
nixosModules/drivers/gpu/nvidia.nix
Normal file
25
nixosModules/drivers/gpu/nvidia.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ lib, config, ... }: {
|
||||
|
||||
options = {
|
||||
settings.drivers.gpu.nvidia.enable = lib.mkEnableOption "Enable Nvidia proprietary drivers";
|
||||
settings.drivers.gpu.nvidia.offload = lib.mkEnableOption "Enable prime offloading";
|
||||
settings.drivers.gpu.nvidia.sync = lib.mkEnableOption "Enable prime sync";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.settings.drivers.gpu.nvidia.enable {
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
prime = {
|
||||
nvidiaBusId = "pci:1:0:0";
|
||||
amdgpuBusId = "pci:5:0:0";
|
||||
};
|
||||
prime.offload = lib.mkIf config.settings.drivers.gpu.nvidia.offload {
|
||||
enable = true;
|
||||
enableOffloadCmd = true;
|
||||
};
|
||||
prime.sync.enable = lib.mkIf config.settings.drivers.gpu.nvidia.sync true;
|
||||
nvidiaSettings = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
13
nixosModules/drivers/gpu/opengl.nix
Normal file
13
nixosModules/drivers/gpu/opengl.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ config, lib, ... }: {
|
||||
options = {
|
||||
settings.drivers.gpu.opengl.enable = lib.mkEnableOption "enable OpenGL hardware support";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.settings.drivers.gpu.opengl.enable {
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
15
nixosModules/drivers/ipod.nix
Normal file
15
nixosModules/drivers/ipod.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ lib, config, pkgs, ... }: {
|
||||
|
||||
options = {
|
||||
settings.drivers.ipod.enable = lib.mkEnableOption "Enable necessary software for ipod communication";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.settings.drivers.ipod.enable {
|
||||
services.usbmuxd.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
libimobiledevice
|
||||
];
|
||||
};
|
||||
|
||||
}
|
||||
10
nixosModules/drivers/samsung-printer.nix
Normal file
10
nixosModules/drivers/samsung-printer.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ lib, config, pkgs, ... }: {
|
||||
#use driver compatible with samsung M2020 printer
|
||||
options = {
|
||||
settings.drivers.printer.M2020.enable = lib.mkEnableOption "use the appropriate driver for the samsung M2020 printer";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.settings.drivers.printer.M2020.enable {
|
||||
services.printing.drivers = [ pkgs.samsung-unified-linux-driver_1_00_37 ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue