Change:
rev = "ae1a34aafce7026b8c0f65a43c9192d756fe1057"; sha256 = "0a4qh5pgyjki904qf7qmvqz2ksxb0p8xhgl2aixfbhixn0pw6saw"; }; <del> executable = writeText "phosh" '' PHOC_INI=@out@/share/phosh/phoc.ini GNOME_SESSION_ARGS="--disable-acceleration-check --session=phosh --debug" if [ -f /etc/phosh/phoc.ini ]; then PHOC_INI=/etc/phosh/phoc.ini elif  [ -f /etc/phosh/rootston.ini ]; then # honor old configs PHOC_INI=/etc/phosh/rootston.ini fi # Run gnome-session through a login shell so it picks # variables from /etc/profile.d (XDG_*) [ -n "$WLR_BACKENDS" ] || WLR_BACKENDS=drm,libinput export WLR_BACKENDS exec "${phoc}/bin/phoc" -C "$PHOC_INI"  -E "bash -lc 'XDG_DATA_DIRS=$XDG_DATA_DIRS:$XDG_DATA_DIRS ${gnome.gnome-session}/bin/gnome-session $GNOME_SESSION_ARGS'" ''; </del> in stdenv.mkDerivation rec { pname = "phosh"; <del> version = "0.10.2"; </del> <ins> version = "0.11.0"; </ins> src = fetchFromGitLab { domain = "source.puri.sm"; owner = "Librem5"; repo = pname; rev = "v${version}"; <del> sha256 = "07i8wpzl7311dcf9s57s96qh1v672c75wv6cllrxx7fsmpf8fhx4"; </del> <ins> sha256 = "104qib4blh32s7bg6j3xza3s9syrxrvyh2wpyh5yx7v5wqarr20x"; </ins> }; nativeBuildInputs = [

Discussion:
Phosh does not have g-s-d available, resulting in the inability to change the screen brightness using the slider in the top bar. The following error is logged: It appears that since we use systemd for gnome-session, it does not start g-s-d: Maybe we need to start phosh using systemd too. There is a . Though for GNOME Shell, g-s-d is started by and I see no such in the upstream . Perhaps we would need to add that mirror the from . cc
I've been using the systemd service, which in turn is inspired by that upstream service. I'm really not familiar with the systemd + user session stuff here, and I tried adding all the from to that session, but it doesn't start things. I assume this is a split from between user and non-user services. As is a system service this way. Is the solution to have this be a user service? Though that wouldn't help with a gdm-started session, right?
Ah, some progress: I feel this is not a solution, but a workaround. It does make keyboard shortcuts work, and brightness work. I have to check more in depth for other things. When ran under gdm (unverified as a service) it also fixes the hardware power/volume buttons being usable. Though oddly it doesn't seem to help with the night light feature. (Looking into another issue.) Could it be that we need to pass something to for it to properly manage with systemd?
Yeah, it would have to be a user service. And unless gnome-session is informed that phosh supports systemd, it will continue using the session file. So if you want the service to be used, you will have to start it manually using . I am not sure what exactly it would take, here is a and a . I also asked at the .
Looking at , we would probably “just” need: Add to Install (and patch the paths there) Create and Use instead of gnome-session flag
Ok, I gave it a try and systemd session management seems to be working. There are two patches to be upstreamed (waiting for Purism to approve my account creation), and I'm not entirely sure what is the correct way to start phoc (currently it sits outside the session).

My branch is , and it can be tested with the following configurations: Edit: Patches submitted to upstream .
I believe those systemd user services should, somehow, be part of the NixOS phosh configuration. I don't know how this could be handled, but ideally enabling posh should, by default, enable this. Or if not by default enabled, a second option like . anything against doing this way? Not sure if this can cause trouble.
Phosh is already in so I would expect it to work.