nix-config/modules/hardware.nix

33 lines
840 B
Nix
Raw Normal View History

{ pkgs, config, lib, ... }:
2023-06-22 17:13:46 +02:00
let
inherit (lib) mkEnableOption;
inherit (pkgs) piper;
cfg = config.modules.hardware;
in
2023-06-22 17:13:46 +02:00
{
options.modules.hardware = {
enable = mkEnableOption "hardware-specific configuration";
mouseSettings = mkEnableOption "piper for mouse settings";
laptopKeyboard = mkEnableOption "laptop keyboard";
lidIgnore = mkEnableOption "lid switch to standby";
powerIgnore = mkEnableOption "ignoring the power key";
};
# TODO: lib.mkIf cfg.enable
config = {
services.ratbagd.enable = true;
environment.systemPackages = [ piper ];
2023-05-17 17:51:52 +02:00
services.udev.extraRules = ''
KERNEL=="event*", ATTRS{name}=="AT Translated Set 2 keyboard", ENV{LIBINPUT_IGNORE_DEVICE}="1"
'';
services.logind = {
lidSwitch = "ignore";
extraConfig = "HandlePowerKey=ignore";
};
};
2023-05-17 17:51:52 +02:00
}