diff --git a/nixos/modules/hardware/video/displaylink.nix b/nixos/modules/hardware/video/displaylink.nix index d8284e85ae45..bee931da1806 100644 --- a/nixos/modules/hardware/video/displaylink.nix +++ b/nixos/modules/hardware/video/displaylink.nix @@ -23,6 +23,8 @@ in boot.extraModulePackages = [ evdi ]; boot.kernelModules = [ "evdi" ]; + services.xserver.externallyConfiguredDrivers = [ "displaylink" ]; + environment.etc."X11/xorg.conf.d/40-displaylink.conf".text = '' Section "OutputClass" Identifier "DisplayLink" diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index fd52b0023d94..b33e6f4ddda1 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -497,7 +497,25 @@ in internal = true; description = '' A list of attribute sets specifying drivers to be loaded by - the X11 server. + the X11 server. This module will create a Device section in + the Xorg config for every driver listed here, along with a + Screen section if the driver's {option}`display` attribute is + `true`. If such configuration sections should not be created, + use {options}`services.xserver.externallyConfiguredDrivers` + instead. + + Users should not add drivers to this option but should instead + add drivers to {option}`services.xserver.videoDrivers`. + ''; + }; + + externallyConfiguredDrivers = mkOption { + type = types.listOf types.str; + internal = true; + description = '' + A list of externally configured drivers (by name). Modules that + manually configure their drivers should add said drivers to this + list to let this module know that the driver has been configured. ''; }; @@ -865,7 +883,9 @@ in } ] ++ map (driver: { - assertion = builtins.elem driver (builtins.catAttrs "name" cfg.drivers); + assertion = builtins.elem driver ( + (builtins.catAttrs "name" cfg.drivers) ++ cfg.externallyConfiguredDrivers + ); message = "Unknown X11 driver ‘${driver}’ specified in `services.xserver.videoDrivers`."; }) cfg.videoDrivers;