sxmo-utils: factor out commons and create a package for sxmo-utils-latest
This commit is contained in:
@@ -1,58 +0,0 @@
|
|||||||
commit bf0057011777b91ef5af005fb4e984b4b9b71c7b
|
|
||||||
Author: Colin <colin@uninsane.org>
|
|
||||||
Date: 2023-07-15 21:35:45 +0000
|
|
||||||
|
|
||||||
sxmo_wmmenu: respect SXMO_WORKSPACE_WRAPPING
|
|
||||||
|
|
||||||
sxmo_wm.sh uses the `SXMO_WORKSPACE_WRAPPING` variable to control
|
|
||||||
relative movements. for example, set this to "5" and then the "Next
|
|
||||||
Workspace" option in the switch menu will cycle WS 1 -> 2 ... -> 5 -> 1.
|
|
||||||
same for one- and two-finger left/right swipe to switch/move workspaces.
|
|
||||||
|
|
||||||
however, absolute movements (via the move menu) only allowed moving to
|
|
||||||
WS 1-4. a user with non-default `SXMO_WORKSPACE_WRAPPING` could move a
|
|
||||||
window from WS 5 to WS 4 with this menu, but not from WS 4 back to WS 5.
|
|
||||||
this patch brings consistency by using `SXMO_WORKSPACE_WRAPPING`
|
|
||||||
anywhere we would otherwise assume the number of possible workspaces.
|
|
||||||
|
|
||||||
diff --git a/scripts/core/sxmo_wmmenu.sh b/scripts/core/sxmo_wmmenu.sh
|
|
||||||
index 3d40b31..d3c1db6 100755
|
|
||||||
--- a/scripts/core/sxmo_wmmenu.sh
|
|
||||||
+++ b/scripts/core/sxmo_wmmenu.sh
|
|
||||||
@@ -12,6 +12,12 @@
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
+_movetowssubmenu() {
|
|
||||||
+ for ws in $(seq "${SXMO_WORKSPACE_WRAPPING:-4}"); do
|
|
||||||
+ printf "%s Move to WS %s\n" "$ws" "$ws"
|
|
||||||
+ done
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
# A menu which allows to move windows or toggle floating.
|
|
||||||
swaymovemenu() {
|
|
||||||
CHOICES="$(cat <<EOF
|
|
||||||
@@ -22,10 +28,7 @@ $icon_arl Move Left
|
|
||||||
$icon_arr Move Right
|
|
||||||
$icon_wn2 Toggle Floating
|
|
||||||
$icon_ac1 Move Scratchpad
|
|
||||||
-1 Move to WS 1
|
|
||||||
-2 Move to WS 2
|
|
||||||
-3 Move to WS 3
|
|
||||||
-4 Move to WS 4
|
|
||||||
+$(_movetowssubmenu)
|
|
||||||
EOF
|
|
||||||
)"
|
|
||||||
|
|
||||||
@@ -125,10 +128,7 @@ dwmwmmenu() {
|
|
||||||
CHOICES="$(
|
|
||||||
cat <<EOF
|
|
||||||
$icon_cls Close Menu
|
|
||||||
-1 Move to WS 1
|
|
||||||
-2 Move to WS 2
|
|
||||||
-3 Move to WS 3
|
|
||||||
-4 Move to WS 4
|
|
||||||
+$(_movetowssubmenu)
|
|
||||||
$icon_rld Shift stack
|
|
||||||
$icon_grd Toggle Layout
|
|
||||||
EOF
|
|
174
pkgs/additional/sxmo-utils/common.nix
Normal file
174
pkgs/additional/sxmo-utils/common.nix
Normal file
@@ -0,0 +1,174 @@
|
|||||||
|
{ stdenv
|
||||||
|
, bash
|
||||||
|
, bc
|
||||||
|
, bemenu
|
||||||
|
, bonsai
|
||||||
|
, brightnessctl
|
||||||
|
, buildPackages
|
||||||
|
, busybox
|
||||||
|
, conky
|
||||||
|
, coreutils
|
||||||
|
, curl
|
||||||
|
, dbus
|
||||||
|
, fetchgit
|
||||||
|
, fetchpatch
|
||||||
|
, gitUpdater
|
||||||
|
, gnugrep
|
||||||
|
, gojq
|
||||||
|
, grim
|
||||||
|
, inotify-tools
|
||||||
|
, j4-dmenu-desktop
|
||||||
|
, jq
|
||||||
|
, lib
|
||||||
|
, libnotify
|
||||||
|
, libxml2
|
||||||
|
, lisgd
|
||||||
|
, makeBinaryWrapper
|
||||||
|
, mako
|
||||||
|
, mepo
|
||||||
|
, modemmanager
|
||||||
|
, nettools
|
||||||
|
, playerctl
|
||||||
|
, procps
|
||||||
|
, pulseaudio
|
||||||
|
, rsync
|
||||||
|
, scdoc
|
||||||
|
, sfeed
|
||||||
|
, superd
|
||||||
|
, sway
|
||||||
|
, swayidle
|
||||||
|
, wob
|
||||||
|
, wvkbd
|
||||||
|
, xdg-user-dirs
|
||||||
|
, xdotool
|
||||||
|
, xrdb
|
||||||
|
|
||||||
|
, version
|
||||||
|
, rev ? version
|
||||||
|
, hash ? ""
|
||||||
|
, patches ? []
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
# anything which any sxmo script or default hook in this package might invoke
|
||||||
|
runtimeDeps = [
|
||||||
|
bc # also in busybox
|
||||||
|
bemenu
|
||||||
|
bonsai
|
||||||
|
brightnessctl
|
||||||
|
conky
|
||||||
|
curl
|
||||||
|
dbus
|
||||||
|
# dmenu # or dmenu-wayland? only used on x11?
|
||||||
|
gnugrep # also in busybox
|
||||||
|
gojq
|
||||||
|
grim
|
||||||
|
inotify-tools
|
||||||
|
j4-dmenu-desktop
|
||||||
|
jq
|
||||||
|
libnotify
|
||||||
|
libxml2.bin # for xmllint; sxmo_weather.sh, sxmo_surf_linkset.sh
|
||||||
|
lisgd
|
||||||
|
mako
|
||||||
|
mepo # mepo_ui_central_menu.sh
|
||||||
|
modemmanager # mmcli
|
||||||
|
nettools # netstat
|
||||||
|
playerctl
|
||||||
|
procps # pgrep
|
||||||
|
pulseaudio # pactl
|
||||||
|
sfeed
|
||||||
|
superd
|
||||||
|
sway
|
||||||
|
swayidle
|
||||||
|
wob
|
||||||
|
wvkbd
|
||||||
|
xdg-user-dirs
|
||||||
|
xrdb # for sxmo_xinit AND sxmo_winit
|
||||||
|
|
||||||
|
# X11 only?
|
||||||
|
xdotool
|
||||||
|
];
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "sxmo-utils";
|
||||||
|
inherit version;
|
||||||
|
|
||||||
|
src = fetchgit {
|
||||||
|
url = "https://git.sr.ht/~mil/sxmo-utils";
|
||||||
|
inherit rev hash;
|
||||||
|
};
|
||||||
|
|
||||||
|
inherit patches;
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
# allow sxmo to source its init file
|
||||||
|
sed -i "s@/etc/profile\.d/sxmo_init.sh@$out/etc/profile.d/sxmo_init.sh@" scripts/core/*.sh
|
||||||
|
# remove absolute paths
|
||||||
|
substituteInPlace scripts/core/sxmo_version.sh \
|
||||||
|
--replace "/usr/bin/" ""
|
||||||
|
|
||||||
|
# let superd find sxmo service binaries at runtime via PATH
|
||||||
|
# TODO: replace with fully-qualified paths
|
||||||
|
sed -i 's:ExecStart=/usr/bin/:ExecStart=/usr/bin/env :' configs/superd/services/*.service
|
||||||
|
|
||||||
|
# install udev rules to where nix expects
|
||||||
|
substituteInPlace Makefile \
|
||||||
|
--replace "/usr/lib/udev/rules.d" "/etc/udev/rules.d"
|
||||||
|
# avoid relative paths in udev rules
|
||||||
|
substituteInPlace configs/udev/90-sxmo.rules \
|
||||||
|
--replace "/bin/chgrp" "${coreutils}/bin/chgrp" \
|
||||||
|
--replace "/bin/chmod" "${coreutils}/bin/chmod"
|
||||||
|
'';
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
makeBinaryWrapper
|
||||||
|
scdoc
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = [ bash ]; # needed here so stdenv's `patchShebangsAuto` hook sets the right interpreter
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
# busybox is used by setup_config_version.sh, but placing it in nativeBuildInputs breaks the nix builder
|
||||||
|
PATH="$PATH:${buildPackages.busybox}/bin" make OPENRC=0 DESTDIR=$out PREFIX= install
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
# we don't wrap sxmo_common.sh or sxmo_init.sh
|
||||||
|
# which is unfortunate, for non-sxmo-utils files that might source though.
|
||||||
|
# if that's a problem, could inject a PATH=... line into them with sed.
|
||||||
|
postInstall = ''
|
||||||
|
for f in \
|
||||||
|
$out/bin/*.sh \
|
||||||
|
$out/share/sxmo/default_hooks/desktop/sxmo_hook_*.sh \
|
||||||
|
$out/share/sxmo/default_hooks/one_button_e_reader/sxmo_hook_*.sh \
|
||||||
|
$out/share/sxmo/default_hooks/three_button_touchscreen/sxmo_hook_*.sh \
|
||||||
|
$out/share/sxmo/default_hooks/sxmo_hook_*.sh \
|
||||||
|
; do
|
||||||
|
case $(basename $f) in
|
||||||
|
(sxmo_common.sh|sxmo_deviceprofile_*.sh|sxmo_hook_icons.sh|sxmo_init.sh)
|
||||||
|
# these are sourced by other scripts: don't wrap them else the `exec` in the wrapper breaks the outer script
|
||||||
|
;;
|
||||||
|
(*)
|
||||||
|
wrapProgram "$f" \
|
||||||
|
--prefix PATH : "${lib.makeBinPath runtimeDeps}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
|
||||||
|
passthru = {
|
||||||
|
providedSessions = [ "sxmo" "swmo" ];
|
||||||
|
updateScript = gitUpdater { };
|
||||||
|
};
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
homepage = "https://git.sr.ht/~mil/sxmo-utils";
|
||||||
|
description = "Contains the scripts and small C programs that glues the sxmo enviroment together";
|
||||||
|
license = lib.licenses.mit;
|
||||||
|
maintainers = with lib.maintainers; [ colinsane ];
|
||||||
|
platforms = lib.platforms.linux;
|
||||||
|
};
|
||||||
|
}
|
@@ -1,226 +1,80 @@
|
|||||||
{ stdenv
|
{ callPackage
|
||||||
, bash
|
|
||||||
, bc
|
|
||||||
, bemenu
|
|
||||||
, bonsai
|
|
||||||
, brightnessctl
|
|
||||||
, buildPackages
|
|
||||||
, busybox
|
|
||||||
, conky
|
|
||||||
, coreutils
|
|
||||||
, curl
|
|
||||||
, dbus
|
|
||||||
, fetchgit
|
|
||||||
, fetchpatch
|
, fetchpatch
|
||||||
, gitUpdater
|
|
||||||
, gnugrep
|
|
||||||
, gojq
|
|
||||||
, grim
|
|
||||||
, inotify-tools
|
|
||||||
, j4-dmenu-desktop
|
|
||||||
, jq
|
|
||||||
, lib
|
|
||||||
, libnotify
|
|
||||||
, libxml2
|
|
||||||
, lisgd
|
|
||||||
, makeBinaryWrapper
|
|
||||||
, mako
|
|
||||||
, mepo
|
|
||||||
, modemmanager
|
|
||||||
, nettools
|
|
||||||
, playerctl
|
|
||||||
, procps
|
|
||||||
, pulseaudio
|
|
||||||
, rsync
|
|
||||||
, scdoc
|
|
||||||
, sfeed
|
|
||||||
, superd
|
|
||||||
, sway
|
|
||||||
, swayidle
|
|
||||||
, wob
|
|
||||||
, wvkbd
|
|
||||||
, xdg-user-dirs
|
|
||||||
, xdotool
|
|
||||||
, xrdb
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
# anything which any sxmo script or default hook in this package might invoke
|
patches = {
|
||||||
runtimeDeps = [
|
merged = [
|
||||||
bc # also in busybox
|
(fetchpatch {
|
||||||
bemenu
|
# merged post 1.14.2
|
||||||
bonsai
|
# [1/2] sxmo_init: behave well when user's primary group differs from their name
|
||||||
brightnessctl
|
# [2/2] sxmo_init: ensure XDG_STATE_HOME exists
|
||||||
conky
|
url = "https://lists.sr.ht/~mil/sxmo-devel/patches/42309/mbox";
|
||||||
curl
|
hash = "sha256-GVWJWTccZeaKsVtsUyZFYl9/qEwJ5U7Bu+DiTDXLjys=";
|
||||||
dbus
|
})
|
||||||
# dmenu # or dmenu-wayland? only used on x11?
|
(fetchpatch {
|
||||||
gnugrep # also in busybox
|
# merged post 1.14.2
|
||||||
gojq
|
# sxmo_hook_block_suspend: don't assume there's only one MPRIS player
|
||||||
grim
|
url = "https://lists.sr.ht/~mil/sxmo-devel/patches/42441/mbox";
|
||||||
inotify-tools
|
hash = "sha256-YmkJ4JLIG/mHosRlVQqvWzujFMBsuDf5nVT3iOi40zU=";
|
||||||
j4-dmenu-desktop
|
})
|
||||||
jq
|
(fetchpatch {
|
||||||
libnotify
|
# merged post 1.14.2
|
||||||
libxml2.bin # for xmllint; sxmo_weather.sh, sxmo_surf_linkset.sh
|
# i only care about patch no. 2
|
||||||
lisgd
|
# [1/2] suspend toggle: silence rm failure noise
|
||||||
mako
|
# [2/2] config: fix keyboard files location
|
||||||
mepo # mepo_ui_central_menu.sh
|
name = "multipatch: 42880";
|
||||||
modemmanager # mmcli
|
url = "https://lists.sr.ht/~mil/sxmo-devel/patches/42880/mbox";
|
||||||
nettools # netstat
|
hash = "sha256-tAMPBb6vwzj1dFMTEaqrcCJU6FbQirwZgB0+tqW3rQA=";
|
||||||
playerctl
|
})
|
||||||
procps # pgrep
|
(fetchpatch {
|
||||||
pulseaudio # pactl
|
# merged post 1.14.2
|
||||||
sfeed
|
name = "Switch from light to brightnessctl";
|
||||||
superd
|
url = "https://git.sr.ht/~mil/sxmo-utils/commit/d0384a7caed036d25228fa3279c36c0230795e4a.patch";
|
||||||
sway
|
hash = "sha256-/UlcuEI5cJnsqRuZ1zWWzR4dyJw/zYeB1rtJWFeSGEE=";
|
||||||
swayidle
|
})
|
||||||
wob
|
(fetchpatch {
|
||||||
wvkbd
|
# merged post 1.14.2
|
||||||
xdg-user-dirs
|
name = "sxmo_hook_lock: allow configuration of auto-screenoff timeout v1";
|
||||||
xrdb # for sxmo_xinit AND sxmo_winit
|
url = "https://lists.sr.ht/~mil/sxmo-devel/patches/42443/mbox";
|
||||||
|
hash = "sha256-c4VySbVJgsbh2h+CnCgwWWe5WkAregpYFqL8n3WRXwY=";
|
||||||
# X11 only?
|
})
|
||||||
xdotool
|
(fetchpatch {
|
||||||
];
|
# merged post 1.14.2
|
||||||
in
|
name = "sxmo_wmmenu: respect SXMO_WORKSPACE_WRAPPING";
|
||||||
stdenv.mkDerivation rec {
|
url = "https://lists.sr.ht/~mil/sxmo-devel/patches/42698/mbox";
|
||||||
pname = "sxmo-utils";
|
hash = "sha256-TrTlrthrpYdIMC8/RCMNaB8PcGQgtya/h2/uLNQDeWs=";
|
||||||
version = "1.14.2";
|
})
|
||||||
|
];
|
||||||
src = fetchgit {
|
unmerged = [
|
||||||
url = "https://git.sr.ht/~mil/sxmo-utils";
|
# let NixOS manage the audio daemons (pulseaudio/pipewire)
|
||||||
rev = version;
|
./0005-system-audio.patch
|
||||||
|
# (fetchpatch {
|
||||||
|
# XXX: doesn't apply cleanly to 1.14.2 release
|
||||||
|
# # Don't wait for led or status bar in state change hooks
|
||||||
|
# # - significantly decreases the time between power-button state transitions
|
||||||
|
# url = "https://lists.sr.ht/~mil/sxmo-devel/patches/43109/mbox";
|
||||||
|
# hash = "sha256-4uR2u6pa62y6SaRHYRn15YGDPILAs7py0mPbAjsgwM4=";
|
||||||
|
# })
|
||||||
|
(fetchpatch {
|
||||||
|
name = "Make config gesture toggle persistent";
|
||||||
|
url = "https://lists.sr.ht/~mil/sxmo-devel/patches/42876/mbox";
|
||||||
|
hash = "sha256-Oa0MI0Kt9Xgl5L1KarHI6Yn4+vpRxUSujB1iY4hlK9c=";
|
||||||
|
})
|
||||||
|
./0104-full-auto-rotate.patch
|
||||||
|
./0105-more-apps.patch
|
||||||
|
# ./0106-no-restart-lisgd.patch
|
||||||
|
];
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
stable = callPackage ./common.nix {
|
||||||
|
version = "1.14.2";
|
||||||
hash = "sha256-1bGCUhf/bt9I8BjG/G7sjYBzLh28iZSC20ml647a3J4=";
|
hash = "sha256-1bGCUhf/bt9I8BjG/G7sjYBzLh28iZSC20ml647a3J4=";
|
||||||
|
patches = patches.merged ++ patches.unmerged;
|
||||||
};
|
};
|
||||||
|
latest = callPackage ./common.nix {
|
||||||
patches = [
|
version = "unstable-2023-08-11";
|
||||||
# needed for basic use:
|
rev = "095678e77fcd9ad2c1ed1ffc98fc66d2f19ccf64";
|
||||||
(fetchpatch {
|
hash = "sha256-TGj3zcwW7aS/5KXcUt0jyESZcNqHY/JZ5HCTgT7Qsbk=";
|
||||||
# merged post 1.14.2
|
patches = patches.unmerged;
|
||||||
# [1/2] sxmo_init: behave well when user's primary group differs from their name
|
|
||||||
# [2/2] sxmo_init: ensure XDG_STATE_HOME exists
|
|
||||||
url = "https://lists.sr.ht/~mil/sxmo-devel/patches/42309/mbox";
|
|
||||||
hash = "sha256-GVWJWTccZeaKsVtsUyZFYl9/qEwJ5U7Bu+DiTDXLjys=";
|
|
||||||
})
|
|
||||||
(fetchpatch {
|
|
||||||
# merged post 1.14.2
|
|
||||||
# sxmo_hook_block_suspend: don't assume there's only one MPRIS player
|
|
||||||
url = "https://lists.sr.ht/~mil/sxmo-devel/patches/42441/mbox";
|
|
||||||
hash = "sha256-YmkJ4JLIG/mHosRlVQqvWzujFMBsuDf5nVT3iOi40zU=";
|
|
||||||
})
|
|
||||||
(fetchpatch {
|
|
||||||
# merged post 1.14.2
|
|
||||||
# i only care about patch no. 2
|
|
||||||
# [1/2] suspend toggle: silence rm failure noise
|
|
||||||
# [2/2] config: fix keyboard files location
|
|
||||||
name = "multipatch: 42880";
|
|
||||||
url = "https://lists.sr.ht/~mil/sxmo-devel/patches/42880/mbox";
|
|
||||||
hash = "sha256-tAMPBb6vwzj1dFMTEaqrcCJU6FbQirwZgB0+tqW3rQA=";
|
|
||||||
})
|
|
||||||
(fetchpatch {
|
|
||||||
# merged post 1.14.2
|
|
||||||
name = "Switch from light to brightnessctl";
|
|
||||||
url = "https://git.sr.ht/~mil/sxmo-utils/commit/d0384a7caed036d25228fa3279c36c0230795e4a.patch";
|
|
||||||
hash = "sha256-/UlcuEI5cJnsqRuZ1zWWzR4dyJw/zYeB1rtJWFeSGEE=";
|
|
||||||
})
|
|
||||||
# wanted to fix/silence some non-fatal errors
|
|
||||||
./0005-system-audio.patch
|
|
||||||
./0007-workspace-wrapping.patch
|
|
||||||
|
|
||||||
# personal (but upstreamable) preferences:
|
|
||||||
(fetchpatch {
|
|
||||||
# merged post 1.14.2
|
|
||||||
name = "sxmo_hook_lock: allow configuration of auto-screenoff timeout v1";
|
|
||||||
url = "https://lists.sr.ht/~mil/sxmo-devel/patches/42443/mbox";
|
|
||||||
hash = "sha256-c4VySbVJgsbh2h+CnCgwWWe5WkAregpYFqL8n3WRXwY=";
|
|
||||||
})
|
|
||||||
# (fetchpatch {
|
|
||||||
# XXX: doesn't apply cleanly to 1.14.2 release
|
|
||||||
# # Don't wait for led or status bar in state change hooks
|
|
||||||
# # - significantly decreases the time between power-button state transitions
|
|
||||||
# url = "https://lists.sr.ht/~mil/sxmo-devel/patches/43109/mbox";
|
|
||||||
# hash = "sha256-4uR2u6pa62y6SaRHYRn15YGDPILAs7py0mPbAjsgwM4=";
|
|
||||||
# })
|
|
||||||
(fetchpatch {
|
|
||||||
name = "Make config gesture toggle persistent";
|
|
||||||
url = "https://lists.sr.ht/~mil/sxmo-devel/patches/42876/mbox";
|
|
||||||
hash = "sha256-Oa0MI0Kt9Xgl5L1KarHI6Yn4+vpRxUSujB1iY4hlK9c=";
|
|
||||||
})
|
|
||||||
./0104-full-auto-rotate.patch
|
|
||||||
./0105-more-apps.patch
|
|
||||||
# ./0106-no-restart-lisgd.patch
|
|
||||||
];
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
# allow sxmo to source its init file
|
|
||||||
sed -i "s@/etc/profile\.d/sxmo_init.sh@$out/etc/profile.d/sxmo_init.sh@" scripts/core/*.sh
|
|
||||||
# remove absolute paths
|
|
||||||
substituteInPlace scripts/core/sxmo_version.sh \
|
|
||||||
--replace "/usr/bin/" ""
|
|
||||||
|
|
||||||
# let superd find sxmo service binaries at runtime via PATH
|
|
||||||
# TODO: replace with fully-qualified paths
|
|
||||||
sed -i 's:ExecStart=/usr/bin/:ExecStart=/usr/bin/env :' configs/superd/services/*.service
|
|
||||||
|
|
||||||
# install udev rules to where nix expects
|
|
||||||
substituteInPlace Makefile \
|
|
||||||
--replace "/usr/lib/udev/rules.d" "/etc/udev/rules.d"
|
|
||||||
# avoid relative paths in udev rules
|
|
||||||
substituteInPlace configs/udev/90-sxmo.rules \
|
|
||||||
--replace "/bin/chgrp" "${coreutils}/bin/chgrp" \
|
|
||||||
--replace "/bin/chmod" "${coreutils}/bin/chmod"
|
|
||||||
'';
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
makeBinaryWrapper
|
|
||||||
scdoc
|
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs = [ bash ]; # needed here so stdenv's `patchShebangsAuto` hook sets the right interpreter
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
# busybox is used by setup_config_version.sh, but placing it in nativeBuildInputs breaks the nix builder
|
|
||||||
PATH="$PATH:${buildPackages.busybox}/bin" make OPENRC=0 DESTDIR=$out PREFIX= install
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
|
|
||||||
# we don't wrap sxmo_common.sh or sxmo_init.sh
|
|
||||||
# which is unfortunate, for non-sxmo-utils files that might source though.
|
|
||||||
# if that's a problem, could inject a PATH=... line into them with sed.
|
|
||||||
postInstall = ''
|
|
||||||
for f in \
|
|
||||||
$out/bin/*.sh \
|
|
||||||
$out/share/sxmo/default_hooks/desktop/sxmo_hook_*.sh \
|
|
||||||
$out/share/sxmo/default_hooks/one_button_e_reader/sxmo_hook_*.sh \
|
|
||||||
$out/share/sxmo/default_hooks/three_button_touchscreen/sxmo_hook_*.sh \
|
|
||||||
$out/share/sxmo/default_hooks/sxmo_hook_*.sh \
|
|
||||||
; do
|
|
||||||
case $(basename $f) in
|
|
||||||
(sxmo_common.sh|sxmo_deviceprofile_*.sh|sxmo_hook_icons.sh|sxmo_init.sh)
|
|
||||||
# these are sourced by other scripts: don't wrap them else the `exec` in the wrapper breaks the outer script
|
|
||||||
;;
|
|
||||||
(*)
|
|
||||||
wrapProgram "$f" \
|
|
||||||
--prefix PATH : "${lib.makeBinPath runtimeDeps}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
'';
|
|
||||||
|
|
||||||
passthru = {
|
|
||||||
providedSessions = [ "sxmo" "swmo" ];
|
|
||||||
updateScript = gitUpdater { };
|
|
||||||
};
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
homepage = "https://git.sr.ht/~mil/sxmo-utils";
|
|
||||||
description = "Contains the scripts and small C programs that glues the sxmo enviroment together";
|
|
||||||
license = lib.licenses.mit;
|
|
||||||
maintainers = with lib.maintainers; [ colinsane ];
|
|
||||||
platforms = lib.platforms.linux;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -55,7 +55,9 @@ let
|
|||||||
sane-weather = callPackage ./additional/sane-weather { };
|
sane-weather = callPackage ./additional/sane-weather { };
|
||||||
static-nix-shell = callPackage ./additional/static-nix-shell { };
|
static-nix-shell = callPackage ./additional/static-nix-shell { };
|
||||||
sublime-music-mobile = callPackage ./additional/sublime-music-mobile { };
|
sublime-music-mobile = callPackage ./additional/sublime-music-mobile { };
|
||||||
sxmo-utils = callPackage ./additional/sxmo-utils { };
|
sxmo-utils' = lib.recurseIntoAttrs (callPackage ./additional/sxmo-utils { });
|
||||||
|
sxmo-utils = sxmo-utils'.stable;
|
||||||
|
sxmo-utils-latest = sxmo-utils'.latest;
|
||||||
tow-boot-pinephone = callPackage ./additional/tow-boot-pinephone { };
|
tow-boot-pinephone = callPackage ./additional/tow-boot-pinephone { };
|
||||||
tree-sitter-nix-shell = callPackage ./additional/tree-sitter-nix-shell { };
|
tree-sitter-nix-shell = callPackage ./additional/tree-sitter-nix-shell { };
|
||||||
unftp = callPackage ./additional/unftp { };
|
unftp = callPackage ./additional/unftp { };
|
||||||
|
Reference in New Issue
Block a user