From f3c3df2ca70bf53e04b6480dbda37ca04ea63cdd Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 27 May 2024 00:23:50 +0000 Subject: [PATCH] sxmo_suspend.sh: lift out of hosts/modules/gui/sxmo/hooks i want to preserve this script for the future, while deleting the rest of my (unused) SXMO config --- hosts/modules/gui/sxmo/default.nix | 8 +------- pkgs/additional/sxmo-suspend/default.nix | 10 ++++++++++ .../additional/sxmo-suspend}/sxmo_suspend.sh | 5 +++++ pkgs/default.nix | 1 + 4 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 pkgs/additional/sxmo-suspend/default.nix rename {hosts/modules/gui/sxmo/hooks => pkgs/additional/sxmo-suspend}/sxmo_suspend.sh (97%) diff --git a/hosts/modules/gui/sxmo/default.nix b/hosts/modules/gui/sxmo/default.nix index d6f40f03..ed754845 100644 --- a/hosts/modules/gui/sxmo/default.nix +++ b/hosts/modules/gui/sxmo/default.nix @@ -95,12 +95,6 @@ let pkgs = [ "systemd" "xdg-user-dirs" ]; srcRoot = ./hooks; }; - suspend = pkgs.static-nix-shell.mkPython3Bin { - pname = "sxmo_suspend.sh"; - pkgs = [ "rtl8723cs-wowlan" "util-linux" ]; - srcRoot = ./hooks; - extraMakeWrapperArgs = [ "--add-flags" "--verbose" ]; - }; }; in { @@ -174,7 +168,7 @@ in "sxmo_hook_postwake.sh" = "${hookPkgs.postwake}/bin/sxmo_hook_postwake.sh"; "sxmo_hook_rotate.sh" = "${hookPkgs.rotate}/bin/sxmo_hook_rotate.sh"; "sxmo_hook_start.sh" = "${hookPkgs.start}/bin/sxmo_hook_start.sh"; - "sxmo_suspend.sh" = "${hookPkgs.suspend}/bin/sxmo_suspend.sh"; + "sxmo_suspend.sh" = "${pkgs.sxmo-suspend}/bin/sxmo_suspend.sh"; }; description = '' extra hooks to add with higher priority than the builtins diff --git a/pkgs/additional/sxmo-suspend/default.nix b/pkgs/additional/sxmo-suspend/default.nix new file mode 100644 index 00000000..9213ba59 --- /dev/null +++ b/pkgs/additional/sxmo-suspend/default.nix @@ -0,0 +1,10 @@ +{ static-nix-shell }: +static-nix-shell.mkPython3Bin { + # name is `sxmo_suspend.sh` because that's the binary this intends to replace + pname = "sxmo_suspend.sh"; + srcRoot = ./.; + pkgs = [ "rtl8723cs-wowlan" "util-linux" ]; + extraMakeWrapperArgs = [ "--add-flags" "--verbose" ]; +} + + diff --git a/hosts/modules/gui/sxmo/hooks/sxmo_suspend.sh b/pkgs/additional/sxmo-suspend/sxmo_suspend.sh similarity index 97% rename from hosts/modules/gui/sxmo/hooks/sxmo_suspend.sh rename to pkgs/additional/sxmo-suspend/sxmo_suspend.sh index 9db1ec99..de87fdeb 100755 --- a/hosts/modules/gui/sxmo/hooks/sxmo_suspend.sh +++ b/pkgs/additional/sxmo-suspend/sxmo_suspend.sh @@ -1,5 +1,10 @@ #!/usr/bin/env nix-shell #!nix-shell -i python3 -p "python3.withPackages (ps: [ ])" -p rtl8723cs-wowlan -p util-linux +""" +replacement `sxmo_suspend.sh` hook for the [SXMO](https://sxmo.org) desktop +which integrates with [ntfy](https://ntfy.sh) in order to stay in deep sleep +until actively woken by a notification. +""" # yeah, this isn't technically a hook, but the hook infrastructure isn't actually # restricted to stuff that starts with sxmo_hook_ ... diff --git a/pkgs/default.nix b/pkgs/default.nix index c74b7b6f..6d32dfb4 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -77,6 +77,7 @@ let swaylock-mobile = callPackage ./additional/swaylock-mobile { }; swaylock-plugin = callPackage ./additional/swaylock-plugin { }; sxmo_swaylock = callPackage ./additional/sxmo_swaylock { }; + sxmo-suspend = callPackage ./additional/sxmo-suspend { }; sxmo-utils = callPackage ./additional/sxmo-utils { }; sysvol = callPackage ./additional/sysvol { }; tow-boot-pinephone = callPackage ./additional/tow-boot-pinephone { };