This commit is contained in:
Geoffrey Frogeye 2025-05-27 19:26:30 +02:00
parent 492f085d52
commit bb021a1aae
30 changed files with 487 additions and 573 deletions

View file

@ -6,18 +6,9 @@
}:
let
displays = {
embedded = {
output = "eDP-1";
edid = "00ffffffffffff000dae381700000000011c01049526157802a155a556519d280b505400000001010101010101010101010101010101b43b804a71383440302035007dd61000001ac32f804a71383440302035007dd61000001a000000fe003059395747803137334843450a00000000000041319e001000000a010a2020004f";
};
deskLeft = {
output = "HDMI-1-3"; # Internal HDMI port
edid = "00ffffffffffff004c2d7b09333032302f160103803420782a01f1a257529f270a505423080081c0810081809500a9c0b300d1c00101283c80a070b023403020360006442100001a000000fd00353f1e5111000a202020202020000000fc00533234423432300a2020202020000000ff0048344d434230333533340a2020010702010400023a80d072382d40102c458006442100001e011d007251d01e206e28550006442100001e011d00bc52d01e20b828554006442100001e8c0ad090204031200c4055000644210000188c0ad08a20e02d10103e9600064421000018000000000000000000000000000000000000000000000000000000000000000000d2";
};
deskRight = {
output = "DVI-I-2-1"; # DisplayLink
edid = "00ffffffffffff004c2d7b093330323020160103803420782a01f1a257529f270a505423080081c0810081809500a9c0b300d1c00101283c80a070b023403020360006442100001a000000fd00353f1e5111000a202020202020000000fc00533234423432300a2020202020000000ff0048344d433830303836350a2020011c02010400023a80d072382d40102c458006442100001e011d007251d01e206e28550006442100001e011d00bc52d01e20b828554006442100001e8c0ad090204031200c4055000644210000188c0ad08a20e02d10103e9600064421000018000000000000000000000000000000000000000000000000000000000000000000d2";
};
embedded = "Chimei Innolux Corporation 0x1738 Unknown";
deskLeft = "Samsung Electric Company S24B420 H4MCB03534"; # Internal HDMI
deskRight = "Samsung Electric Company S24B420 H4MC800865"; # DisplayLink DVI
};
in
{
@ -33,8 +24,6 @@ in
"rtsx_usb_sdmmc"
];
kernelModules = [ "kvm-intel" ];
kernelPackages = pkgs.linuxKernel.packages.linux_6_6;
# displaylink doesn't seem to be working for kernels >= 6.9?
# UEFI works here, and variables can be touched
loader = {
@ -55,12 +44,7 @@ in
hardware.keyboard.qmk.enable = true;
frogeye.desktop = {
x11_screens = [
displays.deskLeft.output
displays.deskRight.output
];
maxVideoHeight = 1440;
numlock = true;
phasesCommands = {
jour = ''
${pkgs.brightnessctl}/bin/brightnessctl set 40000 &
@ -80,44 +64,80 @@ in
# TODO Display 2 doesn't work anymore?
};
};
services = {
autorandr = {
profiles = {
portable = {
fingerprint.${displays.embedded.output} = displays.embedded.edid;
config.${displays.embedded.output} = { };
};
extOnly = {
fingerprint = {
${displays.embedded.output} = displays.embedded.edid;
${displays.deskLeft.output} = displays.deskLeft.edid;
${displays.deskRight.output} = displays.deskRight.edid;
};
config = {
${displays.embedded.output}.enable = false;
${displays.deskLeft.output} = {
primary = true;
mode = "1920x1200";
rate = "59.95";
position = "0x0";
# Screens
home-manager.users.geoffrey =
{ ... }:
{
services = {
kanshi.settings = [
{
profile = {
name = "portable";
outputs = [
{ criteria = displays.embedded; }
];
};
${displays.deskRight.output} = {
mode = "1920x1200";
rate = "59.95";
position = "1920x0";
}
{
profile = {
name = "extOnly";
outputs = [
{
criteria = displays.embedded;
status = "disable";
}
{
criteria = displays.deskLeft;
position = "0,0";
}
{
criteria = displays.deskRight;
position = "1920,0";
}
];
};
};
};
# TODO leftOnly and other things.Might want to abstract a few things first.
}
{
profile = {
name = "leftOnly";
outputs = [
{
criteria = displays.embedded;
status = "disable";
}
{
criteria = displays.deskLeft;
}
];
};
}
];
};
};
# Needs prefetched binary blobs, see https://nixos.wiki/wiki/Displaylink
xserver.videoDrivers = [
"displaylink"
"modesetting"
];
# TODO See if nvidia and DL can work together.
# Displaylink
environment.variables = {
WLR_EVDI_RENDER_DEVICE = "/dev/dri/card1";
};
nixpkgs.overlays = [
(final: prev: {
wlroots_0_18 = prev.wlroots_0_18.overrideAttrs (old: {
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"
"modesetting"
];
systemd.services.dlm.wantedBy = [ "multi-user.target" ];
# Needs prefetched binary blobs, see https://wiki.nixos.org/wiki/Displaylink
};
imports = [
nixos-hardware.nixosModules.dell-g3-3779