Compare commits

...
4 Commits
Author SHA1 Message Date
ahmza eab86bebc7 bollock scommit 2026-08-20 11:09:24 +01:00
ahmza a0d9135695 t480: only arm the keyboard for wake, not the root hubs
Arming the built-in xHCI root hubs made them wake on hub-level events
(USB-C PD negotiation, SD card reader, internal peripherals), causing the
laptop to immediately self-wake from suspend. Drop the root-hub rule and arm
only the keyboard leaf by VID:PID; a leaf device's remote-wakeup propagates
through the hub without the hub's own wakeup flag being set.
2026-08-19 23:50:55 +01:00
ahmza d7894065f7 track cad/freecad/openscad modules referenced by t480
These modules define nixosModules.cad (and freecad/openscad) referenced by
the t480 host module list but were untracked, so the flake could not resolve
them (undefined variable 'cad'). Track them so the build evaluates.
2026-08-19 23:50:48 +01:00
ahmza 6a66db0b20 t480: wake from suspend via built-in-USB keyboard
Add a udev rule (t480UsbWakeup) that arms USB remote-wakeup for a keyboard
on the built-in xHCI controller (00:14.0), so pressing a key wakes the T480
from S3. The dock connects over the Thunderbolt-3 controller (3c:00.0), which
powers down in S3 and cannot detect a cold replug, so dock-connected input
cannot wake the machine after an unplug-triggered suspend; a built-in-port
keyboard can. Match the keyboard by VID:PID since its USB bus path is unstable.

Also wires up the logind lid-switch policy (suspend undocked, ignore docked)
for the clamshell workflow.
2026-08-19 23:39:56 +01:00
10 changed files with 82 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
{
self,
moduleWithSystem,
...
}: {
flake.nixosModules.cad = moduleWithSystem ({...}: let
modules = with self.nixosModules; [
freecad
openscad
prusa-slicer
];
in {
imports = modules;
});
}
+9
View File
@@ -0,0 +1,9 @@
{...}: {
# Screenshot capture, region selection, annotation, and clipboard support for
# the Hyprland screenshot keybinds managed in the dotfiles repo.
flake.nixosModules.freecad = {pkgs, ...}: {
environment.systemPackages = with pkgs; [
freecad
];
};
}
+10
View File
@@ -0,0 +1,10 @@
{...}: {
# Screenshot capture, region selection, annotation, and clipboard support for
# the Hyprland screenshot keybinds managed in the dotfiles repo.
flake.nixosModules.openscad = {pkgs, ...}: {
environment.systemPackages = with pkgs; [
openscad
openscad-lsp
];
};
}
+1
View File
@@ -5,5 +5,6 @@
environment.systemPackages = with pkgs; [
quickshell
];
qt.enable = true;
};
}
+12
View File
@@ -0,0 +1,12 @@
{...}: {
# TODO: previously injected SLSsteam via LD_AUDIT from the sls-steam flake. Now stock.
flake.nixosModules.sunshine = {pkgs, ...}: {
services.sunshine = {
enable = true;
autoStart = true;
capSysAdmin = true;
openFirewall = true;
};
hardware.uinput.enable = true;
};
}
+1
View File
@@ -24,6 +24,7 @@
printing
via
nextcloud
sunshine
];
};
}
+6
View File
@@ -19,6 +19,12 @@
obsidian
discord
gaming
winbox
cad
prusa-slicer
netops
via
t480UsbWakeup
];
};
}
+7
View File
@@ -7,6 +7,13 @@
networking = {
hostName = "t480";
};
services.logind = {
lidSwitch = "suspend";
lidSwitchDocked = "ignore";
};
services.fwupd = {
enable = true;
};
};
}
+19
View File
@@ -0,0 +1,19 @@
{...}: {
flake.nixosModules.t480UsbWakeup = {...}: {
services.udev.extraRules = ''
# Wake the T480 from S3 suspend via a keyboard plugged into a built-in USB
# port. The dock connects over the Thunderbolt-3 controller (3c:00.0), which
# powers down in S3 and cannot detect a cold replug — so dock-connected input
# cannot wake the machine after an unplug-triggered suspend. The built-in xHCI
# (00:14.0) stays wake-capable in S3, so a keyboard on a built-in port works.
#
# Arm ONLY the keyboard itself (match by VID:PID — the USB bus path is
# unstable across re-enumeration). Deliberately do NOT arm the built-in root
# hubs: arming a whole root hub makes it wake on hub-level events (USB-C PD
# negotiation, the SD card reader, internal peripherals), causing spurious
# self-wakes. A leaf device's remote-wakeup propagates through the hub without
# the hub's own wakeup flag being set.
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="320f", ATTR{idProduct}=="5055", ATTR{power/wakeup}="enabled"
'';
};
}
+1
View File
@@ -36,6 +36,7 @@
extraGroups = [
"networkmanager"
"wheel"
"uinput"
];
};
};