mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 14:10:33 +03:00
nixos/displaylink: write out required xorg.conf fragment
Invoke xrandr to actually connect the device. Additionally, we let systemd create the logs directory and use our module loader instead of handling it manually.
This commit is contained in:
parent
198fdd98fb
commit
d936b17d14
1 changed files with 16 additions and 6 deletions
|
@ -19,6 +19,21 @@ in
|
|||
config = mkIf enabled {
|
||||
|
||||
boot.extraModulePackages = [ evdi ];
|
||||
boot.kernelModules = [ "evdi" ];
|
||||
|
||||
environment.etc."X11/xorg.conf.d/40-displaylink.conf".text = ''
|
||||
Section "OutputClass"
|
||||
Identifier "DisplayLink"
|
||||
MatchDriver "evdi"
|
||||
Driver "modesetting"
|
||||
Option "AccelMethod" "none"
|
||||
EndSection
|
||||
'';
|
||||
|
||||
# make the device available
|
||||
services.xserver.displayManager.sessionCommands = ''
|
||||
${lib.getBin pkgs.xorg.xrandr}/bin/xrandr --setprovideroutputsource 1 0
|
||||
'';
|
||||
|
||||
# Those are taken from displaylink-installer.sh and from Arch Linux AUR package.
|
||||
|
||||
|
@ -47,18 +62,13 @@ in
|
|||
description = "DisplayLink Manager Service";
|
||||
after = [ "display-manager.service" ];
|
||||
conflicts = [ "getty@tty7.service" ];
|
||||
path = [ pkgs.kmod ];
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${displaylink}/bin/DisplayLinkManager";
|
||||
Restart = "always";
|
||||
RestartSec = 5;
|
||||
LogsDirectory = "displaylink";
|
||||
};
|
||||
|
||||
preStart = ''
|
||||
mkdir -p /var/log/displaylink
|
||||
modprobe evdi
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue