Displaylink: Difference between revisions

add instructions for display link support on sway/wlroots
Add dlm service
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
===DisplayLink monitors===
===DisplayLink monitors===
In order to use DisplayLink monitors over USB, such as the ASUS MB16AC, the DisplayLink driver needs to be installed:<syntaxhighlight lang="nixos">
In order to use DisplayLink monitors over USB, such as the ASUS MB16AC, the DisplayLink driver needs to be installed.
services.xserver.videoDrivers = [ "displaylink" "modesetting" ];
</syntaxhighlight>The module <code>nixos/modules/hardware/video/displaylink.nix</code> should also work for wlroots compositors.


Since these drivers depend on binary unfree blobs, you will need to first add it to your Nix store. Go to https://www.displaylink.com/downloads/ubuntu to get the appropriate driver version and note the download URL you get after accepting the EULA.
Since these drivers depend on binary unfree blobs, you will need to first add it to your Nix store.


As of 2024-05-01, the current latest version for the driver can be found at https://www.synaptics.com/products/displaylink-graphics/downloads/ubuntu-6.0?filetype=exe. As of 2024-06-27, version 6.0.0 support in NixOS is pending merge of [https://github.com/NixOS/nixpkgs/pull/317292 nixpkgs#317292]
Run <code>nix-shell -p displaylink --arg config '{ allowUnfree = true; }'</code> to get the '''instructions and follow them'''.


After you have downloaded the driver, run something like the following, adjusting the version number in <code>displaylink-600.zip</code> to match the version supported in NixOS at the moment:<syntaxhighlight lang="console">
When you try to use <code>pkgs.displaylink</code> in your nixos system, you will get the same instructions printed to the stderr, follow those to prefetch the driver. Once the blob is in the Nix store you can add the package<syntaxhighlight lang="nix">
$ nix-prefetch-url --name displaylink-600.zip https://www.synaptics.com/sites/default/files/exe_files/2024-05/DisplayLink%20USB%20Graphics%20Software%20for%20Ubuntu6.0-EXE.zip
environment.systemPackages = with pkgs; [
displaylink
];
</syntaxhighlight>Then add the videoDrivers:<syntaxhighlight lang="nixos">services.xserver.videoDrivers = [ "displaylink" "modesetting" ];</syntaxhighlight>The module <code>nixos/modules/hardware/video/displaylink.nix</code> should also work for wlroots compositors.
 
At last - at least on Gnome using wayland you also have to enable ` dml`  service<syntaxhighlight lang="nix">
systemd.services.dlm.wantedBy = [ "multi-user.target" ];
</syntaxhighlight>
</syntaxhighlight>


Line 35: Line 39:
nixpkgs.overlays = [
nixpkgs.overlays = [
   (final: prev: {     
   (final: prev: {     
     wlroots_0_17 = prev.wlroots_0_17.overrideAttrs (old: {                                                                                    
     wlroots_0_17 = prev.wlroots_0_17.overrideAttrs (old: { # you may need to use 0_18
       patches = (old.patches or [ ]) ++ [  
       patches = (old.patches or [ ]) ++ [
         (prev.fetchpatch {
         (prev.fetchpatch {
           url = "https://gitlab.freedesktop.org/wlroots/wlroots/uploads/bd115aa120d20f2c99084951589abf9c/DisplayLink_v2.patch";
           url = "https://gitlab.freedesktop.org/wlroots/wlroots/uploads/bd115aa120d20f2c99084951589abf9c/DisplayLink_v2.patch";
Line 48: Line 52:
systemd.services.dlm.wantedBy = [ "multi-user.target" ];
systemd.services.dlm.wantedBy = [ "multi-user.target" ];
</syntaxhighlight>
</syntaxhighlight>
[Source https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/1823#note_2146862]


Note as of [https://github.com/NixOS/nixpkgs/pull/351752 2024-10-30] nixos-unstable sway uses <code>wlroots_0_18</code>. The patch above applies correctly but you will need to invoke sway with the <code>--unsupported-gpu</code> flag.
[https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/1823#note_2146862 Source]


[[Category:Video]]
[[Category:Video]]