meta: Merge logind with piper

This is a part of putting hardware-related configs together so they
don't distract from the other shell-related and desktop-related configs.
This commit is contained in:
Donovan Glover 2024-04-03 07:10:46 -04:00
parent 2e64dbd3e3
commit 2452f61338
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
2 changed files with 27 additions and 12 deletions

View File

@ -1,6 +0,0 @@
{
services.logind = {
lidSwitch = "ignore";
extraConfig = "HandlePowerKey=ignore";
};
}

View File

@ -1,11 +1,32 @@
{ pkgs, ... }:
{ pkgs, config, lib, ... }:
let
inherit (lib) mkEnableOption;
inherit (pkgs) piper;
cfg = config.modules.hardware;
in
{
services.ratbagd.enable = true;
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";
};
environment.systemPackages = [ pkgs.piper ];
# TODO: lib.mkIf cfg.enable
config = {
services.ratbagd.enable = true;
environment.systemPackages = [ piper ];
services.udev.extraRules = ''
KERNEL=="event*", ATTRS{name}=="AT Translated Set 2 keyboard", ENV{LIBINPUT_IGNORE_DEVICE}="1"
'';
services.udev.extraRules = ''
KERNEL=="event*", ATTRS{name}=="AT Translated Set 2 keyboard", ENV{LIBINPUT_IGNORE_DEVICE}="1"
'';
services.logind = {
lidSwitch = "ignore";
extraConfig = "HandlePowerKey=ignore";
};
};
}