Displaylink: Difference between revisions
Hughobrien (talk | contribs) remove note about pending pr that was merged https://github.com/NixOS/nixpkgs/pull/324121 |
m Date seemed wrong |
||
(3 intermediate revisions by one other user not shown) | |||
Line 4: | Line 4: | ||
</syntaxhighlight>The module <code>nixos/modules/hardware/video/displaylink.nix</code> should also work for wlroots compositors. | </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 | Since these drivers depend on binary unfree blobs, you will need to first add it to your Nix store. | ||
When you try to use <code>pkgs.displaylink</code> in your nixos system, you will get the instructions printed to the stderr, follow those to prefetch the driver. | |||
Run <code>nix-shell -p displaylink --arg config '{ allowUnfree = true; }'</code> to get the instructions. | |||
====Connecting a second external monitor==== | ====Connecting a second external monitor==== | ||
Line 49: | Line 47: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Note as of [https://github.com/NixOS/nixpkgs/pull/351752 | 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] | [https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/1823#note_2146862 Source] | ||
[[Category:Video]] | [[Category:Video]] |
Latest revision as of 20:33, 2 April 2025
DisplayLink monitors
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" ];
The module nixos/modules/hardware/video/displaylink.nix
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.
When you try to use pkgs.displaylink
in your nixos system, you will get the instructions printed to the stderr, follow those to prefetch the driver.
Run nix-shell -p displaylink --arg config '{ allowUnfree = true; }'
to get the instructions.
Connecting a second external monitor
In order to add a second external monitor you can add the following to your configuration:
services.xserver.displayManager.sessionCommands = ''
${lib.getBin pkgs.xorg.xrandr}/bin/xrandr --setprovideroutputsource 2 0
'';
Sway
Identify which card has the render device, evdi
is the DisplayLink interface, so it's not card0
, but card1
.
$ ls -l /dev/dri/by-path
lrwxrwxrwx - root 2 Nov 13:38 pci-0000:00:02.0-card -> ../card1
lrwxrwxrwx - root 2 Nov 13:38 pci-0000:00:02.0-render -> ../renderD128
lrwxrwxrwx - root 2 Nov 13:38 platform-evdi.0-card -> ../card0
environment.variables = {
WLR_EVDI_RENDER_DEVICE = "/dev/dri/card1";
};
nixpkgs.overlays = [
(final: prev: {
wlroots_0_17 = prev.wlroots_0_17.overrideAttrs (old: { # you may need to use 0_18
patches = (old.patches or [ ]) ++ [
(prev.fetchpatch {
url = "https://gitlab.freedesktop.org/wlroots/wlroots/uploads/bd115aa120d20f2c99084951589abf9c/DisplayLink_v2.patch";
hash = "sha256-vWQc2e8a5/YZaaHe+BxfAR/Ni8HOs2sPJ8Nt9pfxqiE=";
})
];
});
})
];
services.xserver.videoDrivers = [ "displaylink" ];
systemd.services.dlm.wantedBy = [ "multi-user.target" ];
Note as of 2024-10-30 nixos-unstable sway uses wlroots_0_18
. The patch above applies correctly but you will need to invoke sway with the --unsupported-gpu
flag.