From 012163eb44ba49fabc0ab60ce2aac1ec4a18f4d7 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sun, 7 Mar 2021 17:47:59 +0000 Subject: [PATCH] modules: add ergodox This enables usage of ZSA tools, such as `wally` or their online training tool for any users that are part of `plugdev`. --- modules/default.nix | 1 + modules/ergodox.nix | 16 ++++++++++++++++ modules/users.nix | 1 + 3 files changed, 18 insertions(+) create mode 100644 modules/ergodox.nix diff --git a/modules/default.nix b/modules/default.nix index 8af74a9..9db0efb 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -3,6 +3,7 @@ { imports = [ + ./ergodox.nix ./language.nix ./networking.nix ./nix.nix diff --git a/modules/ergodox.nix b/modules/ergodox.nix new file mode 100644 index 0000000..cbc4957 --- /dev/null +++ b/modules/ergodox.nix @@ -0,0 +1,16 @@ +# ZSA keyboard udev rules +{ config, lib, ... }: +let + cfg = config.my.modules.ergodox; +in +{ + options.my.modules.ergodox = with lib; { + enable = mkEnableOption "ZSA udev rules and user group configuration"; + }; + + config = lib.mkIf cfg.enable { + hardware.keyboard.zsa.enable = true; + + users.extraGroups = [ "plugdev" ]; + }; +} diff --git a/modules/users.nix b/modules/users.nix index 291418d..d6ddd93 100644 --- a/modules/users.nix +++ b/modules/users.nix @@ -19,6 +19,7 @@ in isNormalUser = true; shell = pkgs.zsh; extraGroups = groupsIfExist [ + "plugdev" # usage of ZSA keyboard tools "media" # access to media files "wheel" # `sudo` for the user. ];