https://github.com/oxzi/nixos-thinkpad-dock
NixOS module for ThinkPads and docking stations
https://github.com/oxzi/nixos-thinkpad-dock
docking-station nixos nixos-module thinkpad
Last synced: 9 months ago
JSON representation
NixOS module for ThinkPads and docking stations
- Host: GitHub
- URL: https://github.com/oxzi/nixos-thinkpad-dock
- Owner: oxzi
- License: mit
- Created: 2020-05-22T14:10:47.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-01T12:29:32.000Z (over 5 years ago)
- Last Synced: 2025-07-17T13:43:04.073Z (12 months ago)
- Topics: docking-station, nixos, nixos-module, thinkpad
- Language: Nix
- Size: 5.86 KB
- Stars: 10
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NixOS Thinkpad Dock
Small NixOS module for ThinkPads to perform certain tasks during docking and
undocking on the docking station. Technically this is realized by creating an
`acpid` handler.
## Usage
This repository needs to be included in the NixOS configuration. An example
follows.
```nix
{ config, pkgs, ... }:
{
imports = [
/path/to/nixos-thinkpad-dock
];
hardware = {
thinkpad-dock = {
enable = true;
# Those are needed for xrandr.
environment = ''
export DISPLAY=:0
export XAUTHORITY=/home/user/.Xauthority
'';
# Add a second monitor while docking and remove it again.
dockEvent = ''
${pkgs.xorg.xrandr}/bin/xrandr --output DP-2-1 --mode 1920x1080 --right-of eDP-1
'';
undockEvent = ''
${pkgs.xorg.xrandr}/bin/xrandr --output DP-2-1 --off
'';
};
};
}
```