dotfiles/curacao/hardware.nix

145 lines
3.9 KiB
Nix

{
pkgs,
lib,
nixos-hardware,
...
}:
let
displays = {
embedded = "Chimei Innolux Corporation 0x1738 Unknown";
deskLeft = "Samsung Electric Company S24B420 H4MCB03534"; # Internal HDMI
deskRight = "Samsung Electric Company S24B420 H4MC800865"; # DisplayLink DVI
};
in
{
config = {
boot = {
# From nixos-generate-config
initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usbhid"
"sd_mod"
"rtsx_usb_sdmmc"
];
kernelModules = [ "kvm-intel" ];
# UEFI works here, and variables can be touched
loader = {
efi.canTouchEfiVariables = lib.mkDefault true;
grub = {
enable = true;
efiSupport = true;
device = "nodev"; # Don't install on MBR
# TODO Maybe we could? In case the HDD doesn't boot anymore?
};
};
};
# Also from nixos-generate-config
hardware.enableRedistributableFirmware = true;
# TODO Do we really need that? Besides maybe microcode?
# AnnePro 2
hardware.keyboard.qmk.enable = true;
frogeye.desktop = {
maxVideoHeight = 1440;
phasesCommands = {
jour = ''
${pkgs.brightnessctl}/bin/brightnessctl set 40000 &
# ${pkgs.ddcutil}/bin/ddcutil setvcp 10 20 -d 1 &
# ${pkgs.ddcutil}/bin/ddcutil setvcp 10 20 -d 2 &
'';
crepuscule = ''
${pkgs.brightnessctl}/bin/brightnessctl set 10000 &
# ${pkgs.ddcutil}/bin/ddcutil setvcp 10 10 -d 1 &
# ${pkgs.ddcutil}/bin/ddcutil setvcp 10 10 -d 2 &
'';
nuit = ''
${pkgs.brightnessctl}/bin/brightnessctl set 1 &
# ${pkgs.ddcutil}/bin/ddcutil setvcp 10 0 -d 1 &
# ${pkgs.ddcutil}/bin/ddcutil setvcp 10 0 -d 2 &
'';
# TODO Display 2 doesn't work anymore?
};
};
# Screens
home-manager.users.geoffrey =
{ ... }:
{
services = {
kanshi.settings = [
{
profile = {
name = "portable";
outputs = [
{ criteria = displays.embedded; }
];
};
}
{
profile = {
name = "extOnly";
outputs = [
{
criteria = displays.embedded;
status = "disable";
}
{
criteria = displays.deskLeft;
position = "0,0";
}
{
criteria = displays.deskRight;
position = "1920,0";
}
];
};
}
{
profile = {
name = "leftOnly";
outputs = [
{
criteria = displays.embedded;
status = "disable";
}
{
criteria = displays.deskLeft;
}
];
};
}
];
};
};
# 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
];
}