WIP: sxmo: ship deps via package instead of at the DE level

This commit is contained in:
2023-06-23 02:12:23 +00:00
parent ec3a7067b6
commit 8f9cef6ff3
2 changed files with 69 additions and 24 deletions

View File

@@ -187,33 +187,10 @@ in
# TODO: could use `displayManager.sessionPackages`? # TODO: could use `displayManager.sessionPackages`?
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
bc
bemenu
bonsai
conky
gojq
inotify-tools
j4-dmenu-desktop
jq
libnotify
lisgd
mako
sfeed
superd
sway
swayidle
sxmo-utils sxmo-utils
wob
wvkbd
xdg-user-dirs
# X11 only?
xdotool
cfg.deviceHooks cfg.deviceHooks
cfg.hooks cfg.hooks
] ++ lib.optionals (config.services.pipewire.pulse.enable) [ pulseaudio ] # for pactl ] ++ lib.optionals (cfg.terminal != null) [ pkgs."${cfg.terminal}" ]
++ lib.optionals (cfg.terminal != null) [ pkgs."${cfg.terminal}" ]
++ lib.optionals (cfg.keyboard != null) [ pkgs."${cfg.keyboard}" ]; ++ lib.optionals (cfg.keyboard != null) [ pkgs."${cfg.keyboard}" ];
environment.sessionVariables = { environment.sessionVariables = {

View File

@@ -1,11 +1,58 @@
{ stdenv { stdenv
, bc
, bemenu
, bonsai
, conky
, fetchgit , fetchgit
, gitUpdater , gitUpdater
, gojq
, inotify-tools
, j4-dmenu-desktop
, jq
, lib , lib
, libnotify
, lisgd
, makeWrapper
, mako
, pulseaudio
, rsync , rsync
, scdoc , scdoc
, sfeed
, superd
, sway
, swayidle
, wob
, wvkbd
, xdg-user-dirs
, xdotool
}: }:
let
runtimeDeps = [
bc
bemenu
bonsai
conky
gojq
inotify-tools
j4-dmenu-desktop
jq
libnotify
lisgd
mako
pulseaudio
sfeed
superd
sway
swayidle
wob
wvkbd
xdg-user-dirs
# X11 only?
xdotool
];
in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "sxmo-utils"; pname = "sxmo-utils";
version = "1.14.2"; version = "1.14.2";
@@ -41,6 +88,7 @@ stdenv.mkDerivation rec {
''; '';
nativeBuildInputs = [ nativeBuildInputs = [
makeWrapper
scdoc scdoc
]; ];
@@ -50,6 +98,26 @@ stdenv.mkDerivation rec {
"PREFIX=" "PREFIX="
]; ];
# 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/etc/profile.d/sxmo_init.sh \
$out/sxmo/default_hooks/desktop/sxmo_hook_*.sh \
$out/sxmo/default_hooks/one_button_e_reader/sxmo_hook_*.sh \
$out/sxmo/default_hooks/three_button_touchscreen/sxmo_hook_*.sh \
$out/sxmo/default_hooks/sxmo_hook_*.sh \
$out/sxmo/profile.d/sxmo_init.sh \
; do
if [ $(basename $f) != sxmo_common.sh -a $(basename $f) != sxmo_init.sh ]; then
wrapProgram "$f" \
--prefix PATH : "${lib.makeBinPath runtimeDeps}"
fi
done
'';
passthru = { passthru = {
providedSessions = [ "sxmo" "swmo" ]; providedSessions = [ "sxmo" "swmo" ];
updateScript = gitUpdater { }; updateScript = gitUpdater { };