about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2021-04-17T13·53+0200
committerflokli <flokli@flokli.de>2021-04-17T19·35+0000
commitc4c23a0715cd65bdd1ddcf522bfd94f018012548 (patch)
treec47debca1763667e7e43a8c44c3cc4f3b3772dca
parent48098f83c1e3943d1fb76aaecdce3b4f56cf4d4a (diff)
feat(tverskoy): enable eink tooling r/2523
Provide ddcutil and paperlike-go in $PATH. Provide the necessary udev
and kernel module plumbing so they work as non-root.

Icecream-Required-From: Vincent Ambo <mail@tazj.in>
Change-Id: Ic9323a45cdbb75571e8f8b3aca4b9a763c271968
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3029
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
-rw-r--r--users/tazjin/nixos/tverskoy/default.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/users/tazjin/nixos/tverskoy/default.nix b/users/tazjin/nixos/tverskoy/default.nix
index ff707bc2f9bc..b6b639ec717e 100644
--- a/users/tazjin/nixos/tverskoy/default.nix
+++ b/users/tazjin/nixos/tverskoy/default.nix
@@ -50,7 +50,7 @@ in lib.fix(self: {
       zfs rollback -r zpool/ephemeral/home@tazjin-clean
     '';
 
-    kernelModules = [ "kvm-amd" ];
+    kernelModules = [ "kvm-amd" "i2c_dev" ];
     extraModulePackages = [ ];
     kernelPackages = nixpkgs.linuxPackages_latest;
     loader.systemd-boot.enable = true;
@@ -163,6 +163,11 @@ in lib.fix(self: {
     mullvad-vpn.enable = true;
     tlp.enable = true;
 
+    # expose i2c device as /dev/i2c-amdgpu-dm and make it user-accessible
+    udev.extraRules = ''
+      SUBSYSTEM=="i2c-dev", ACTION=="add", DEVPATH=="/devices/pci0000:00/0000:00:08.1/0000:06:00.0/i2c-5/i2c-dev/i2c-5", SYMLINK+="i2c-amdgpu-dm", TAG+="uaccess"
+    '';
+
     xserver = {
       enable = true;
       layout = "us";
@@ -227,6 +232,7 @@ in lib.fix(self: {
       chromium
       curl
       direnv
+      ddcutil
       dnsutils
       emacs27-nox # emacsclient
       exa
@@ -252,6 +258,7 @@ in lib.fix(self: {
       openssh
       openssl
       pass
+      paperlike-go
       pavucontrol
       pinentry
       pinentry-emacs