diff --git a/hosts/modules/gui/sxmo/default.nix b/hosts/modules/gui/sxmo/default.nix index 09cf8074..89514190 100644 --- a/hosts/modules/gui/sxmo/default.nix +++ b/hosts/modules/gui/sxmo/default.nix @@ -66,6 +66,23 @@ let echo "launching ${identifier}..." | ${systemd-cat} --identifier=${identifier} ${cmd} 2>&1 | ${systemd-cat} --identifier=${identifier} ''; + + hookPkgs = { + inputhandler = pkgs.static-nix-shell.mkBash { + pname = "sxmo_hook_inputhandler.sh"; + src = ./hooks; + pkgs = [ "coreutils" ]; + }; + start = pkgs.static-nix-shell.mkBash { + pname = "sxmo_hook_start.sh"; + src = ./hooks; + pkgs = [ "superd" "xdg-user-dirs" ]; + }; + postwake = pkgs.static-nix-shell.mkBash { + pname = "sxmo_hook_postwake.sh"; + src = ./hooks; + }; + }; in { options = with lib; { @@ -106,9 +123,9 @@ in sane.gui.sxmo.hooks = mkOption { type = types.attrsOf types.path; default = { - "sxmo_hook_start.sh" = ./hooks/sxmo_hook_start.sh; - "sxmo_hook_inputhandler.sh" = ./hooks/sxmo_hook_inputhandler.sh; - "sxmo_hook_postwake.sh" = ./hooks/sxmo_hook_postwake.sh; + "sxmo_hook_start.sh" = "${hookPkgs.start}/bin/sxmo_hook_start.sh"; + "sxmo_hook_inputhandler.sh" = "${hookPkgs.inputhandler}/sxmo_hook_inputhandler.sh"; + "sxmo_hook_postwake.sh" = "${hookPkgs.postwake}/sxmo_hook_postwake.sh"; }; description = '' extra hooks to add with higher priority than the builtins diff --git a/hosts/modules/gui/sxmo/hooks/sxmo_hook_inputhandler.sh b/hosts/modules/gui/sxmo/hooks/sxmo_hook_inputhandler.sh index b0174273..b7b4e695 100755 --- a/hosts/modules/gui/sxmo/hooks/sxmo_hook_inputhandler.sh +++ b/hosts/modules/gui/sxmo/hooks/sxmo_hook_inputhandler.sh @@ -1,4 +1,5 @@ -#!/bin/sh +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p coreutils # increments to use for volume adjustment VOL_INCR_1=5 diff --git a/hosts/modules/gui/sxmo/hooks/sxmo_hook_postwake.sh b/hosts/modules/gui/sxmo/hooks/sxmo_hook_postwake.sh old mode 100644 new mode 100755 index 36f0bd0e..ffd09b73 --- a/hosts/modules/gui/sxmo/hooks/sxmo_hook_postwake.sh +++ b/hosts/modules/gui/sxmo/hooks/sxmo_hook_postwake.sh @@ -1,4 +1,5 @@ -#!/bin/sh +#!/usr/bin/env nix-shell +#!nix-shell -i bash # the default sxmo_postwake handler checks if the modem is offline # and if so installs a wakelock to block suspend for 30s. diff --git a/hosts/modules/gui/sxmo/hooks/sxmo_hook_start.sh b/hosts/modules/gui/sxmo/hooks/sxmo_hook_start.sh index 39f3f392..63339077 100755 --- a/hosts/modules/gui/sxmo/hooks/sxmo_hook_start.sh +++ b/hosts/modules/gui/sxmo/hooks/sxmo_hook_start.sh @@ -1,4 +1,5 @@ -#!/bin/sh +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p superd -p xdg-user-dirs # this is based on upstream sxmo-utils sxmo_hook_start.sh # but modified for nixos integration and specialize a bit to my needs . sxmo_common.sh