about summary refs log tree commit diff
path: root/modules/nixos/solaar.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-11-25 18:09:05 +0300
committerAzat Bahawi <azat@bahawi.net>2023-11-25 18:09:05 +0300
commite2cc46b37e33643cf3dd017adb8a009bf143e246 (patch)
tree86f24ea544e9ed75bf8736c951a09dfdb2219f5d /modules/nixos/solaar.nix
parent2023-11-23 (diff)
2023-11-25
Diffstat (limited to '')
-rw-r--r--modules/nixos/solaar.nix25
1 files changed, 11 insertions, 14 deletions
diff --git a/modules/nixos/solaar.nix b/modules/nixos/solaar.nix
index 64aafc8..ccfff4a 100644
--- a/modules/nixos/solaar.nix
+++ b/modules/nixos/solaar.nix
@@ -26,20 +26,17 @@ in {
           # 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
-            getExe pkg;
+          ExecStartPre = getExe (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
+            '';
+          });
           ExecStart = "${getExe pkgs.solaar "solaar"} --window=hide";
         };
         Install.WantedBy = ["graphical-session.target"];

Consider giving Nix/NixOS a try! <3