nixos/hardware: clean up "with lib;" for keyboards

Changed files
+15 -17
nixos
modules
hardware
+3 -3
nixos/modules/hardware/keyboard/teck.nix
···
{ config, lib, pkgs, ... }:
-
with lib;
let
cfg = config.hardware.keyboard.teck;
in
{
options.hardware.keyboard.teck = {
-
enable = mkEnableOption (lib.mdDoc "non-root access to the firmware of TECK keyboards");
};
config = mkIf cfg.enable {
services.udev.packages = [ pkgs.teck-udev-rules ];
};
}
-
···
{ config, lib, pkgs, ... }:
let
cfg = config.hardware.keyboard.teck;
+
inherit (lib) mdDoc mkEnableOption mkIf;
+
in
{
options.hardware.keyboard.teck = {
+
enable = mkEnableOption (mdDoc "non-root access to the firmware of TECK keyboards");
};
config = mkIf cfg.enable {
services.udev.packages = [ pkgs.teck-udev-rules ];
};
}
+4 -3
nixos/modules/hardware/keyboard/uhk.nix
···
{ config, lib, pkgs, ... }:
-
with lib;
let
cfg = config.hardware.keyboard.uhk;
in
{
options.hardware.keyboard.uhk = {
-
enable = mkEnableOption (lib.mdDoc ''
-
non-root access to the firmware of UHK keyboards.
You need it when you want to flash a new firmware on the keyboard.
Access to the keyboard is granted to users in the "input" group.
You may want to install the uhk-agent package.
···
{ config, lib, pkgs, ... }:
let
cfg = config.hardware.keyboard.uhk;
+
inherit (lib) mdDoc mkEnableOption mkIf;
+
in
{
options.hardware.keyboard.uhk = {
+
enable = mkEnableOption (mdDoc ''
+
non-root access to the firmware of UHK keyboards.
You need it when you want to flash a new firmware on the keyboard.
Access to the keyboard is granted to users in the "input" group.
You may want to install the uhk-agent package.
+8 -11
nixos/modules/hardware/keyboard/zsa.nix
···
{ config, lib, pkgs, ... }:
let
-
inherit (lib) mkOption mkIf types;
cfg = config.hardware.keyboard.zsa;
in
{
options.hardware.keyboard.zsa = {
-
enable = mkOption {
-
type = types.bool;
-
default = false;
-
description = lib.mdDoc ''
-
Enables udev rules for keyboards from ZSA like the ErgoDox EZ, Planck EZ and Moonlander Mark I.
-
You need it when you want to flash a new configuration on the keyboard
-
or use their live training in the browser.
-
You may want to install the wally-cli package.
-
'';
-
};
};
config = mkIf cfg.enable {
···
{ config, lib, pkgs, ... }:
let
cfg = config.hardware.keyboard.zsa;
+
inherit (lib) mkEnableOption mkIf mdDoc;
+
in
{
options.hardware.keyboard.zsa = {
+
enable = mkEnableOption (mdDoc ''
+
udev rules for keyboards from ZSA like the ErgoDox EZ, Planck EZ and Moonlander Mark I.
+
You need it when you want to flash a new configuration on the keyboard
+
or use their live training in the browser.
+
You may want to install the wally-cli package.
+
'');
};
config = mkIf cfg.enable {