sxmo: add missing deps to custom hooks

This commit is contained in:
Colin 2023-09-24 17:48:18 +00:00
parent 3ab943ab0b
commit e5d843b21f
4 changed files with 26 additions and 6 deletions

View File

@ -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

View File

@ -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

3
hosts/modules/gui/sxmo/hooks/sxmo_hook_postwake.sh Normal file → Executable file
View File

@ -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.

View File

@ -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