dotfiles/modules/nixos/hardware/logitech/default.nix

35 lines
895 B
Nix
Raw Normal View History

2023-07-14 01:24:18 +00:00
{
config,
lib,
pkgs,
2024-08-03 16:21:12 +00:00
namespace,
2023-07-14 01:24:18 +00:00
...
2024-08-03 16:21:12 +00:00
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.${namespace}.hardware.logitech;
username = config.${namespace}.user.name;
2023-07-14 01:24:18 +00:00
in {
2024-08-03 16:21:12 +00:00
options.${namespace}.hardware.logitech = {
2023-07-14 01:24:18 +00:00
enable = mkEnableOption "logitech devices";
};
config = mkIf cfg.enable {
hardware.logitech.wireless = {
enable = true;
enableGraphical = true;
};
systemd.user.services.solaar = {
description = "Linux device manager for Logitech devices";
documentation = ["https://pwr-solaar.github.io/Solaar/"];
partOf = ["graphical-session.target"];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.solaar}/bin/solaar -w hide";
};
};
2024-08-03 16:21:12 +00:00
systemd.user.services.solaar.wantedBy = mkIf config.home-manager.users.${username}.wayland.windowManager.sway.enable ["sway-session.target"];
2023-07-14 01:24:18 +00:00
};
}