Project description
The Phone鈥檚 shell Phosh is based on GNOME technologies (GTK, GSettings, DBus) and uses a custom Wayland compositor.
Metadata
As NixOS will be supported on new linux friendly phone called PinePhone this package could provide highly usable mobile UI.
Packaging of this should be quite easy (postmarketOS build definitions, that show dependencies and build systems used, are available). Main problems are some rust dependencies in squeekboard (virtual keyboard for Phosh) which is dependency for this package.
Build definitions that could help:
Phosh - main package
Phoc - dependency package - custom wayland compositor
Squeekboard - dependency package - custom virtual keyboard
Older version is packaged here https://github.com/NixOS/nixpkgs/pull/57614
Just Squeekboard is missing. I think this is the main keyboard for Phosh. (I'm not sure what is the roadmap for Squeekboard and Virtboard)
Nice. Would be helpful for Mobile NixOS!
cc @samueldr
Hi @jtojnar .
Last week I started playing with Mobile NixOS on my PinePhone. I managed to build latest kernel 5.6 (PR is coming) and run gnome. I'd want to run Phosh and I've been trying for almost a week to build latest version. I used your PR as a base and after some changes and hacks, I have something that builds successfully but fails on runtime. I'm stuck with these errors:
[jordi@nixos:~] startphosh
libEGL warning: DRI2: failed to authenticate
(phoc:1101): phoc-wlroots-CRITICAL **: 18:48:33.329: [xwaylad/sockets.c:63] Failed to bind socker @/tmp/.X11-unix/X0: Address already in use
(phoc:1101): GLib-GIO-ERROR **: 18.48.33.360: Settings schema 'sm.puri.phoc' is not installed
I tried setting the path to sm.puri.phoc
manually on XDG_DATA_DIRS
but doesn't work. Here is the configuration.nix
and the derivations I'm using to test it. Could you take a look please?
Thank you in advance!
@masipcat Few things I noticed:
configurePhase = "meson build --prefix=$out";
buildPhase = "ninja -C build";
installPhase = "ninja -C build install";
Meson can use cmake
for finding dependencies but it is generally not necessary.
I could not build phoc on account of it not being able to find wlroots but I would guess the gschemas.compiled
file is not generated. Maybe try adding
postInstall = ''
glib-compile-schemas "$out"/share/glib-2.0/schemas
'';
I am beginning to lean torwards setting DESTDIR=/
and creating a setup hook to compile the schemas automatically but until then, we will need to do that manually.
Thank you very much for your answare.
@masipcat Few things I noticed:
1. These are the default phases so you can remove them:
configurePhase = "meson build --prefix=$out"; buildPhase = "ninja -C build"; installPhase = "ninja -C build install";
If I remove these lines I get this error (and I'm not sure how to fix it...):
building '/nix/store/j79ssqaiz92vknwdvdhz8rc0ajrybg0b-phoc-master.drv'...
unpacking sources
unpacking source archive /nix/store/dv7b2izhzxfn3m1wvsnammm4fj6q3j1n-source
source root is source
patching sources
configuring
fixing cmake files...
cmake flags: -GNinja -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_BUILD_RPATH=ON -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix/store/8r374n17j0nl10ibjw96f6vqm3kn8739-phoc-master/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/8r374n17j0nl10ibjw96f6vqm3kn8739-phoc-master/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/8r374n17j0nl10ibjw96f6vqm3kn8739-phoc-master/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/8r374n17j0nl10ibjw96f6vqm3kn8739-phoc-master/share/doc/ -DCMAKE_INSTALL_INFODIR=/nix/store/8r374n17j0nl10ibjw96f6vqm3kn8739-phoc-master/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/8r374n17j0nl10ibjw96f6vqm3kn8739-phoc-master/share/man -DCMAKE_INSTALL_OLDINCLUDEDIR=/nix/store/8r374n17j0nl10ibjw96f6vqm3kn8739-phoc-master/include -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/8r374n17j0nl10ibjw96f6vqm3kn8739-phoc-master/include -DCMAKE_INSTALL_SBINDIR=/nix/store/8r374n17j0nl10ibjw96f6vqm3kn8739-phoc-master/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/8r374n17j0nl10ibjw96f6vqm3kn8739-phoc-master/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/8r374n17j0nl10ibjw96f6vqm3kn8739-phoc-master/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_OSX_SYSROOT= -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_FIND_FRAMEWORK=last -DCMAKE_STRIP=/nix/store/nyhj00w339gk2gaj3faz70gjrnbmam8v-binutils-2.31.1/bin/strip -DCMAKE_RANLIB=/nix/store/nyhj00w339gk2gaj3faz70gjrnbmam8v-binutils-2.31.1/bin/ranlib -DCMAKE_AR=/nix/store/nyhj00w339gk2gaj3faz70gjrnbmam8v-binutils-2.31.1/bin/ar -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_INSTALL_PREFIX=/nix/store/8r374n17j0nl10ibjw96f6vqm3kn8739-phoc-master
CMake Error: The source directory "/build/source" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
2. I could not build phoc on account of it not being able to find wlroots but I would guess the `gschemas.compiled` file is not generated. Maybe try adding
postInstall = '' glib-compile-schemas "$out"/share/glib-2.0/schemas '';
This fixed the Settings schema 'sm.puri.phoc' is not installed
:)
In the meantime, I configured passthru.providedSessions
in the phosh package and done some hacks so I can set phosh
as the defaultSession for the lightdm, but after log in, the screen goes black (just the mouse cursor). Looking at journalctl
I see:
May 03 16:12:29 nixos systemd[1]: Started Network Manager Wait Online.
May 03 16:12:29 nixos systemd[1]: Reached target Network is Online.
May 03 16:12:29 nixos systemd[1]: Started Name Service Cache Daemon.
May 03 16:12:29 nixos systemd-logind[768]: New seat seat0.
May 03 16:12:29 nixos systemd-logind[768]: Watching system buttons on /dev/input/event2 (Power Button)
May 03 16:12:29 nixos systemd-logind[768]: Watching system buttons on /dev/input/event0 (AT Translated Set 2 keyboard)
May 03 16:12:29 nixos systemd[1]: Started Login Service.
May 03 16:12:29 nixos systemd[1]: Reached target Multi-User System.
May 03 16:12:29 nixos systemd[1]: Starting X11 Server...
May 03 16:12:29 nixos systemd[1]: Started X11 Server.
May 03 16:12:29 nixos systemd[1]: Reached target Graphical Interface.
May 03 16:12:29 nixos systemd[1]: Startup finished in 2.698s (kernel) + 5.007s (userspace) = 7.705s.
May 03 16:12:31 nixos systemd[1]: Created slice user-78.slice.
May 03 16:12:31 nixos systemd[1]: Starting User Runtime Directory /run/user/78...
May 03 16:12:31 nixos systemd-logind[768]: New session c1 of user lightdm.
May 03 16:12:31 nixos systemd[1]: Started User Runtime Directory /run/user/78.
May 03 16:12:31 nixos systemd[1]: Starting User Manager for UID 78...
May 03 16:12:31 nixos systemd[860]: pam_unix(systemd-user:session): session opened for user lightdm by (uid=0)
May 03 16:12:31 nixos systemd[860]: Reached target Paths.
May 03 16:12:31 nixos systemd[860]: Reached target Timers.
May 03 16:12:31 nixos systemd[860]: Listening on Multimedia System.
May 03 16:12:31 nixos systemd[860]: Listening on Sound System.
May 03 16:12:31 nixos systemd[860]: Reached target Sockets.
May 03 16:12:31 nixos systemd[860]: Reached target Basic System.
May 03 16:12:31 nixos systemd[1]: Started User Manager for UID 78.
May 03 16:12:31 nixos systemd[1]: Started Session c1 of user lightdm.
May 03 16:12:31 nixos systemd[860]: Reached target Main User Target.
May 03 16:12:31 nixos systemd[860]: Startup finished in 198ms.
May 03 16:12:31 nixos dbus-daemon[871]: [session uid=78 pid=869] Activating service name='org.a11y.Bus' requested by ':1.0' (uid=78 pid=865 comm="/nix/store/6wgpgdmjnh8cl7k8zbhv1k7m08x4jv1z-lightd" label="kernel")
May 03 16:12:31 nixos dbus-daemon[871]: [session uid=78 pid=869] Successfully activated service 'org.a11y.Bus'
May 03 16:12:33 nixos org.a11y.Bus[871]: dbus-daemon[878]: Activating service name='org.a11y.atspi.Registry' requested by ':1.0' (uid=78 pid=865 comm="/nix/store/6wgpgdmjnh8cl7k8zbhv1k7m08x4jv1z-lightd" label="kernel")
May 03 16:12:33 nixos org.a11y.Bus[871]: dbus-daemon[878]: Successfully activated service 'org.a11y.atspi.Registry'
May 03 16:12:33 nixos org.a11y.Bus[871]: SpiRegistry daemon is running with well-known name - org.a11y.atspi.Registry
May 03 16:12:38 nixos lightdm[887]: gkr-pam: unable to locate daemon control file
May 03 16:12:38 nixos lightdm[887]: pam_unix(lightdm:session): session opened for user jordi by (uid=0)
May 03 16:12:38 nixos systemd[1]: Created slice user-1000.slice.
May 03 16:12:38 nixos systemd[1]: Starting User Runtime Directory /run/user/1000...
May 03 16:12:38 nixos systemd-logind[768]: New session 2 of user jordi.
May 03 16:12:38 nixos systemd[1]: Started User Runtime Directory /run/user/1000.
May 03 16:12:38 nixos systemd[1]: Starting User Manager for UID 1000...
May 03 16:12:38 nixos systemd[898]: pam_unix(systemd-user:session): session opened for user jordi by (uid=0)
May 03 16:12:38 nixos systemd[898]: Reached target Paths.
May 03 16:12:38 nixos systemd[898]: Reached target Timers.
May 03 16:12:38 nixos systemd[898]: Listening on Multimedia System.
May 03 16:12:38 nixos systemd[898]: Listening on Sound System.
May 03 16:12:38 nixos systemd[898]: Reached target Sockets.
May 03 16:12:38 nixos systemd[898]: Reached target Basic System.
May 03 16:12:38 nixos systemd[1]: Started User Manager for UID 1000.
May 03 16:12:38 nixos systemd[1]: Started Session 2 of user jordi.
May 03 16:12:38 nixos systemd[898]: Reached target Main User Target.
May 03 16:12:38 nixos systemd[898]: Startup finished in 111ms.
May 03 16:12:38 nixos systemd[1]: session-c1.scope: Killing process 856 (lightdm) with signal SIGTERM.
May 03 16:12:38 nixos systemd[1]: session-c1.scope: Killing process 865 (.lightdm-gtk-gr) with signal SIGTERM.
May 03 16:12:38 nixos systemd[1]: session-c1.scope: Killing process 870 (dbus-launch) with signal SIGTERM.
May 03 16:12:38 nixos systemd[1]: session-c1.scope: Killing process 871 (dbus-daemon) with signal SIGTERM.
May 03 16:12:38 nixos systemd[1]: session-c1.scope: Killing process 873 (.at-spi-bus-lau) with signal SIGTERM.
May 03 16:12:38 nixos systemd[1]: session-c1.scope: Killing process 878 (dbus-daemon) with signal SIGTERM.
May 03 16:12:38 nixos systemd[1]: session-c1.scope: Killing process 890 (at-spi2-registr) with signal SIGTERM.
May 03 16:12:38 nixos systemd[1]: Stopping Session c1 of user lightdm.
May 03 16:12:38 nixos systemd[1]: NetworkManager-dispatcher.service: Succeeded.
May 03 16:12:38 nixos xsession[908]: /nix/store/xlywn24f3hs3f7izn4mblmzdbbipybax-xrdb-1.2.0/bin/xrdb: Can't open display ''
May 03 16:12:39 nixos systemd[898]: Reached target Current graphical user session.
May 03 16:12:39 nixos .gnome-session-[925]: Could not make bus activated clients aware of XDG_CURRENT_DESKTOP=GNOME environment variable: Could not connect: Connection refused
May 03 16:12:39 nixos xsession[908]: pci id for fd 9: 1234:1111, driver (null)
May 03 16:12:40 nixos .gnome-session-[947]: Could not make bus activated clients aware of XDG_CURRENT_DESKTOP=GNOME environment variable: Could not connect: Connection refused
May 03 16:12:40 nixos gnome-session[947]: gnome-session-binary[947]: WARNING: Could not make bus activated clients aware of XDG_MENU_PREFIX=gnome- environment variable: Could not connect: Connection refused
May 03 16:12:40 nixos gnome-session-binary[947]: WARNING: Could not make bus activated clients aware of XDG_MENU_PREFIX=gnome- environment variable: Could not connect: Connection refused
May 03 16:12:40 nixos gnome-session[947]: gnome-session-binary[947]: WARNING: Lost name on bus: org.gnome.SessionManager
May 03 16:12:40 nixos gnome-session-binary[947]: WARNING: Lost name on bus: org.gnome.SessionManager
May 03 16:12:40 nixos gnome-session-f[968]: Cannot open display:
May 03 16:12:41 nixos systemd[1]: session-c1.scope: Succeeded.
May 03 16:12:41 nixos systemd[1]: Stopped Session c1 of user lightdm.
May 03 16:12:41 nixos systemd-logind[768]: Removed session c1.
Do you have any clue on what's happening and how to fix it? Here is the configuration.nix + derivations config-deriv.zip. You can test it running nix-build '<nixpkgs/nixos>' -A vm -I nixos-config=./vm-configuration.nix
to reproduce this behavior.
@masipcat
If I remove these lines I get this error (and I'm not sure how to fix it...):
[...] CMake Error: The source directory "/build/source" does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI.
You should drop cmake
as it likely is not necessary, otherwise you need to set dontUseCmakeConfigure = true;
to prevent cmake
from taking over.
In the meantime, I configured
passthru.providedSessions
in the phosh package and done some hacks so I can setphosh
as the defaultSession for the lightdm, but after log in, the screen goes black (just the mouse cursor). Looking atjournalctl
I see:[...] May 03 16:12:38 nixos systemd[1]: NetworkManager-dispatcher.service: Succeeded. May 03 16:12:38 nixos xsession[908]: /nix/store/xlywn24f3hs3f7izn4mblmzdbbipybax-xrdb-1.2.0/bin/xrdb: Can't open display '' May 03 16:12:39 nixos systemd[898]: Reached target Current graphical user session. May 03 16:12:39 nixos .gnome-session-[925]: Could not make bus activated clients aware of XDG_CURRENT_DESKTOP=GNOME environment variable: Could not connect: Connection refused May 03 16:12:39 nixos xsession[908]: pci id for fd 9: 1234:1111, driver (null) May 03 16:12:40 nixos .gnome-session-[947]: Could not make bus activated clients aware of XDG_CURRENT_DESKTOP=GNOME environment variable: Could not connect: Connection refused May 03 16:12:40 nixos gnome-session[947]: gnome-session-binary[947]: WARNING: Could not make bus activated clients aware of XDG_MENU_PREFIX=gnome- environment variable: Could not connect: Connection refused May 03 16:12:40 nixos gnome-session-binary[947]: WARNING: Could not make bus activated clients aware of XDG_MENU_PREFIX=gnome- environment variable: Could not connect: Connection refused May 03 16:12:40 nixos gnome-session[947]: gnome-session-binary[947]: WARNING: Lost name on bus: org.gnome.SessionManager May 03 16:12:40 nixos gnome-session-binary[947]: WARNING: Lost name on bus: org.gnome.SessionManager May 03 16:12:40 nixos gnome-session-f[968]: Cannot open display: May 03 16:12:41 nixos systemd[1]: session-c1.scope: Succeeded. May 03 16:12:41 nixos systemd[1]: Stopped Session c1 of user lightdm. May 03 16:12:41 nixos systemd-logind[768]: Removed session c1.
Do you have any clue on what's happening and how to fix it? Here is the configuration.nix + derivations config-deriv.zip. You can test it running
nix-build '<nixpkgs/nixos>' -A vm -I nixos-config=./vm-configuration.nix
to reproduce this behavior.
Not that familiar with this part of stack, maybe @hedning will know more.
Finally I got it working on gdm
! (still fails on lightdm
)
@jtojnar btw, if I remove cmake
building the derivation fails. I'll clean up the current derivations and if you don't mind,I'll open a draft PR to discuss how to fix theses things, it'll be easier than attaching zips...
I marked this as stale due to inactivity. → More info
Would still be helpful for Mobile NixOS!
Most helpful comment
Finally I got it working on
gdm
! (still fails onlightdm
)@jtojnar btw, if I remove
cmake
building the derivation fails. I'll clean up the current derivations and if you don't mind,I'll open a draft PR to discuss how to fix theses things, it'll be easier than attaching zips...