From e2cc46b37e33643cf3dd017adb8a009bf143e246 Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Sat, 25 Nov 2023 18:09:05 +0300 Subject: 2023-11-25 --- modules/nixos/solaar.nix | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'modules/nixos/solaar.nix') 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"]; -- cgit 1.4.1