Add basic support for onlykey

This commit is contained in:
Vili Sinervä 2024-10-10 19:49:52 +03:00
parent c5185ac416
commit 790be4e9a7
No known key found for this signature in database
GPG key ID: DF8FEAF54EFAC996
3 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,22 @@
{ config, pkgs, ... }:
{
assertions = [
{
assertion = config.users.users ? "vili";
message = "User 'vili' needed for onlykey!";
}
];
environment.systemPackages = with pkgs; [
onlykey
onlykey-cli
onlykey-agent
];
services.udev.extraRules = with pkgs; ''
ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="60fc", ENV{ID_MM_DEVICE_IGNORE}="1"
ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="60fc", ENV{MTP_NO_PROBE}="1"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="60fc", OWNER:="vili", RUN+="${onlykey-cli}/bin/onlykey-cli settime"
KERNEL=="ttyACM*", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="60fc", OWNER:="vili", RUN+="${onlykey-cli}/bin/onlykey-cli settime"
'';
}

View file

@ -76,6 +76,7 @@
../hardware-specific/trackball.nix ../hardware-specific/trackball.nix
../hardware-specific/amd-laptop.nix ../hardware-specific/amd-laptop.nix
../hardware-specific/usb-automount.nix ../hardware-specific/usb-automount.nix
../hardware-specific/onlykey.nix
]; ];
services.xserver.displayManager.setupCommands = '' services.xserver.displayManager.setupCommands = ''

View file

@ -56,6 +56,7 @@
../hardware-specific/keychron-q11.nix ../hardware-specific/keychron-q11.nix
../hardware-specific/trackball.nix ../hardware-specific/trackball.nix
../hardware-specific/usb-automount.nix ../hardware-specific/usb-automount.nix
../hardware-specific/onlykey.nix
]; ];
system.autoUpgrade.allowReboot = pkgs.lib.mkForce false; system.autoUpgrade.allowReboot = pkgs.lib.mkForce false;