summaryrefslogtreecommitdiff
path: root/modules/nixfiles/solaar.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/nixfiles/solaar.nix')
-rw-r--r--modules/nixfiles/solaar.nix54
1 files changed, 0 insertions, 54 deletions
diff --git a/modules/nixfiles/solaar.nix b/modules/nixfiles/solaar.nix
deleted file mode 100644
index ceff23d..0000000
--- a/modules/nixfiles/solaar.nix
+++ /dev/null
@@ -1,54 +0,0 @@
-{
- config,
- lib,
- pkgs,
- ...
-}:
-with lib; let
- cfg = config.nixfiles.modules.solaar;
-in {
- options.nixfiles.modules.solaar = {
- enable = mkEnableOption "Solaar";
- };
-
- config = mkIf cfg.enable {
- hm = {
- home.packages = with pkgs; [solaar];
-
- systemd.user.services.solaar = {
- Unit = {
- Description = "Device manager for Logitech devices";
- After = ["graphical-session-pre.target"];
- PartOf = ["graphical-session.target"];
- };
- Service = {
- # The dirtiest hack I've ever implemented... I should be ashamed of
- # it. Regardless, that shit still doesn't work because each reconnect,
- # /dev/hidraw* is recreated and has default permissions which breaks
- # Solaar. Fuck this shit.
- ExecStartPre = let
- pkg = pkgs.writeShellApplication {
- name = "solaar-pre";
- text = ''
- for i in /dev/hidraw*; do
- if [ -c "$i" ]; then
- sudo chown root:input "$i"
- sudo chmod 0660 "$i"
- fi
- done
- '';
- };
- in "${pkg}/bin/solaar-pre";
- ExecStart = "${pkgs.solaar}/bin/solaar --window=hide";
- };
- Install.WantedBy = ["graphical-session.target"];
- };
- };
-
- boot.kernelModules = ["hid_logitech_dj" "hid_logitech_hidpp"];
-
- hardware.uinput.enable = true;
-
- my.extraGroups = ["uinput" "input"];
- };
-}