Displaylink: Difference between revisions

Add dlm service
add details for KDE and Gnome
Tags: Mobile edit Mobile web edit Visual edit
 
Line 12: Line 12:
</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.
</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">
====<big>Xserver</big>====
systemd.services.dlm.wantedBy = [ "multi-user.target" ];
=====Connecting a second external monitor=====
</syntaxhighlight>
 
====Connecting a second external monitor====
In order to add a second external monitor you can add the following to your configuration:
In order to add a second external monitor you can add the following to your configuration:


Line 22: Line 19:
     ${lib.getBin pkgs.xorg.xrandr}/bin/xrandr --setprovideroutputsource 2 0
     ${lib.getBin pkgs.xorg.xrandr}/bin/xrandr --setprovideroutputsource 2 0
'';</syntaxhighlight>
'';</syntaxhighlight>
[[Category:Video]]
====Wayland====
At first add displayLink driver to nix store as above described.
=====evdi module=====
You probably will need the `evdi` module
{{bc|<nowiki>
boot = {
  extraModulePackages = [ config.boot.kernelPackages.evdi ];
  initrd = {
    # List of modules that are always loaded by the initrd.
    kernelModules = [
      "evdi"
    ];
  };
};
</nowiki>}}
====='''Gnome Wayland'''=====
Install displayLink package
{{bc|<nowiki>
environment.systemPackages = with pkgs; [
  displaylink
];
</nowiki>}}
Define videoDrivers
{{bc|<nowiki>
services.xserver.videoDrivers = [ "displaylink" ];
</nowiki>}}
Add dlm service
{{bc|<nowiki>
systemd.services.dlm.wantedBy = [ "multi-user.target" ];
</nowiki>}}
====='''KDE Plasma'''=====
Apparently KDE Plasma (Wayland) requires a slight different approach.
Esnure you properly enabled wayland session
{{bc|<nowiki>
environment.variables = {
  KWIN_DRM_PREFER_COLOR_DEPTH = "24";
};
services = {
  desktopManager.plasma6 = {
    enable = true;
  };
  displayManager = {
    sddm = {
      enable = true;
      wayland.enable = true;
    };
    defaultSession = "plasma";
  };
};
</nowiki>}}
Install displayLink package
{{bc|<nowiki>
environment.systemPackages = with pkgs; [
  displaylink
];
</nowiki>}}
Instead of dlm setup display-link server as follows:
{{bc|<nowiki>
# --- THIS IS THE CRUCIAL PART FOR ENABLING THE SERVICE ---
systemd.services.displaylink-server = {
  enable = true;
  # Ensure it starts after udev has done its work
  requires = [ "systemd-udevd.service" ];
  after = [ "systemd-udevd.service" ];
  wantedBy = [ "multi-user.target" ]; # Start at boot
  # *** THIS IS THE CRITICAL 'serviceConfig' BLOCK ***
  serviceConfig = {
    Type = "simple"; # Or "forking" if it forks (simple is common for daemons)
    # The ExecStart path points to the DisplayLinkManager binary provided by the package
    ExecStart = "${pkgs.displaylink}/bin/DisplayLinkManager";
    # User and Group to run the service as (root is common for this type of daemon)
    User = "root";
    Group = "root";
    # Environment variables that the service itself might need
    # Environment = [ "DISPLAY=:0" ]; # Might be needed in some cases, but generally not for this
    Restart = "on-failure";
    RestartSec = 5; # Wait 5 seconds before restarting
  };
};
</nowiki>}}


==Sway==
==Sway==