qmk/ergodox/udev: cleanup

This commit is contained in:
2024-06-30 16:52:36 +00:00
parent 98c4a5ec87
commit 6bbe3a8e23
8 changed files with 40 additions and 2 deletions

View File

@@ -62,6 +62,7 @@
sane.ids.clightning.gid = 2419;
sane.ids.nix-serve.uid = 2420;
sane.ids.nix-serve.gid = 2420;
sane.ids.plugdev.gid = 2421;
sane.ids.colin.uid = 1000;
sane.ids.guest.uid = 1100;

View File

@@ -175,10 +175,12 @@ in
# "gh" # MS GitHub cli
"nix-index"
"nixpkgs-review"
"qmk-udev-rules"
"sane-scripts.dev"
"sequoia"
# "via"
"wally-cli"
"zsa-udev-rules"
# "zsa-udev-rules"
];
consoleMediaUtils = declPackageSet [
@@ -365,7 +367,7 @@ in
"inkscape"
# "jellyfin-media-player"
"kdenlive"
"keymapp"
# "keymapp"
# "kid3" # audio tagging
"krita"
"libreoffice" # TODO: replace with an office suite that uses saner packaging?

View File

@@ -116,6 +116,7 @@
./portfolio-filemanager.nix
./playerctl.nix
./ps.nix
./qmk-udev-rules.nix
./rhythmbox.nix
./ripgrep.nix
./rofi
@@ -153,6 +154,7 @@
./tor-browser.nix
./tuba.nix
./unl0kr
./via.nix
./vlc.nix
./wally-cli.nix
./waybar

View File

@@ -0,0 +1,9 @@
{ config, lib, ... }:
let
cfg = config.sane.programs.qmk-udev-rules;
in
{
sane.programs.qmk-udev-rules.sandbox.enable = false;
services.udev.packages = lib.mkIf cfg.enabled [ cfg.package ];
}

View File

@@ -0,0 +1,17 @@
# - <https://nixos.wiki/wiki/Qmk>
# via lets one change the keymap on a QMK keyboard without reflashing
# - intro: <https://www.caniusevia.com/docs/specification>
{ config, lib, pkgs, ... }:
let
cfg = config.sane.programs.via;
in
{
sane.programs.via = {
enableFor.system = lib.mkIf (builtins.any (en: en) (builtins.attrValues cfg.enableFor.user)) true;
};
services.udev.packages = lib.mkIf cfg.enabled [ cfg.package pkgs.qmk-udev-rules ];
services.udev.extraRules = ''
# ZSA Ergodox Glow
SUBSYSTEMS=="usb", ATTRS{idVendor}=="3297", ATTRS{idProduct}=="4976", TAG+="uaccess"
'';
}

View File

@@ -56,6 +56,11 @@ in
services.logind.powerKey = "lock";
services.logind.powerKeyLongPress = "poweroff";
services.logind.lidSwitch = "lock";
# under logind, 'uaccess' tag would grant the logged in user access to a device.
# outside logind, map uaccess tag -> plugdev group to grant that access.
services.udev.extraRules = ''
TAG=="uaccess" GROUP="plugdev"
'';
systemd.extraConfig = ''
# DefaultTimeoutStopSec defaults to 90s, and frequently blocks overall system shutdown.

View File

@@ -22,6 +22,7 @@
"media" # servo
"networkmanager"
"nixbuild"
"plugdev" # desko, for ZSA/QMK/udev
"render" # for crappy, /dev/dri/render*
"seat" # for sway, if using seatd
"systemd-journal" # allows to view other user's journals (esp system users)

View File

@@ -21,6 +21,7 @@ in
];
users.groups.media = {};
users.groups.plugdev = {};
# Users are exactly these specified here;
# old ones will be deleted (from /etc/passwd, etc) upon upgrade.