From 2452f6133808226cbcb9b126762ba0737f0e2799 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Wed, 3 Apr 2024 07:10:46 -0400 Subject: [PATCH] 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. --- modules/logind.nix | 6 ------ modules/piper.nix | 33 +++++++++++++++++++++++++++------ 2 files changed, 27 insertions(+), 12 deletions(-) delete mode 100644 modules/logind.nix diff --git a/modules/logind.nix b/modules/logind.nix deleted file mode 100644 index 7b718792..00000000 --- a/modules/logind.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - services.logind = { - lidSwitch = "ignore"; - extraConfig = "HandlePowerKey=ignore"; - }; -} diff --git a/modules/piper.nix b/modules/piper.nix index c017ab2b..85735e21 100644 --- a/modules/piper.nix +++ b/modules/piper.nix @@ -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"; + }; + }; }