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

This commit is contained in:
Colin 2023-06-23 02:12:23 +00:00
parent ec3a7067b6
commit 931838fb0d
3 changed files with 73 additions and 25 deletions

View File

@ -252,7 +252,7 @@
deployScript = action: pkgs.writeShellScript "deploy-moby" ''
nixos-rebuild --flake '.#moby' build $@
sudo nix sign-paths -r -k /run/secrets/nix_serve_privkey $(readlink ./result)
nixos-rebuild --flake '.#moby' ${action} --target-host colin@moby-hn --use-remote-sudo $@
nixos-rebuild --flake '.#moby' ${action} --target-host colin@moby --use-remote-sudo $@
'';
in {
update-feeds = {

View File

@ -187,33 +187,10 @@ in
# TODO: could use `displayManager.sessionPackages`?
environment.systemPackages = with pkgs; [
bc
bemenu
bonsai
conky
gojq
inotify-tools
j4-dmenu-desktop
jq
libnotify
lisgd
mako
sfeed
superd
sway
swayidle
sxmo-utils
wob
wvkbd
xdg-user-dirs
# X11 only?
xdotool
cfg.deviceHooks
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}" ];
environment.sessionVariables = {

View File

@ -1,11 +1,58 @@
{ stdenv
, bc
, bemenu
, bonsai
, conky
, fetchgit
, gitUpdater
, gojq
, inotify-tools
, j4-dmenu-desktop
, jq
, lib
, libnotify
, lisgd
, makeWrapper
, mako
, pulseaudio
, rsync
, 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 {
pname = "sxmo-utils";
version = "1.14.2";
@ -41,6 +88,7 @@ stdenv.mkDerivation rec {
'';
nativeBuildInputs = [
makeWrapper
scdoc
];
@ -50,6 +98,29 @@ stdenv.mkDerivation rec {
"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/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 { };