Fist of all a bit of context, I'm using Project Trident and it has this cool feature:
After user login if we restart users-session tree
I don't know if there is a solution for this problem or not or if it's easy to implement, but will be a super cool feature to have users tree that works with encrypted user home.
So when you enable 66 boot-user@ user it doesn't start at next bootAll user home directories are encrypted out of box. The individual user directories are only “unlocked” and decrypted when that user logs in to the system. Logging out or rebooting the system automatically locks home directories.
doas 66-intree -zg users-session 5.7s
Name : users-session
Initialized : yes
Enabled : yes
Starts after : root
Current : no
Allowed : root
Symlinks : svc->source db->source
Contents : /
|-(down,Enabled,oneshot) setenv@ gspe
|-(1540,Enabled,longrun) svscan@ gspe-log
|-(0,Enabled,longrun) svscan@ gspe
|-(down,Enabled,module) scandir@ gspe
|-(down,Enabled,oneshot) mount-run@ gspe
|-(down,Enabled,module) boot-user@ gspe
|-(1542,Enabled,longrun) dbus-log
|-(1550,Enabled,longrun) dbus
|-(1541,Enabled,longrun) sddm-log
`-(1563,Enabled,longrun) sddm
If we look at logs:
cat /run/66/log/0/current
....
2020-12-12 09:28:14.627148268 all-Runtime: info: starts...
2020-12-12 09:28:14.654640073 execl-toc: fatal: unable to create dir: /usr/home/gspe/.local/66/conf/svscan@ gspe: Permission denied
2020-12-12 09:28:14.670061297 66-start: fatal: unable to start services selection
2020-12-12 09:28:14.670122291 66-all: fatal: unable to start services of tree: users-session
2020-12-12 09:28:14.670977755 all-Runtime: fatal: crashed! -- Your machine is operational but some runtime service failed to start correctly. Please see the complete boot log at /run/66/log/0/current for further information.
we can see that it fail to create a dir inside user home.After user login if we restart users-session tree
doas 66-all -v 4 -t users-session up
...
doas 66-intree -zg users-session 3942ms
Name : users-session
Initialized : yes
Enabled : yes
Starts after : root
Current : no
Allowed : root
Symlinks : svc->source db->source
Contents : /
|-(up,Enabled,oneshot) setenv@ gspe
|-(1540,Enabled,longrun) svscan@ gspe-log
|-(14483,Enabled,longrun) svscan@ gspe
|-(up,Enabled,module) scandir@ gspe
|-(up,Enabled,oneshot) mount-run@ gspe
|-(up,Enabled,module) boot-user@ gspe
|-(1542,Enabled,longrun) dbus-log
|-(1550,Enabled,longrun) dbus
|-(1541,Enabled,longrun) sddm-log
`-(1563,Enabled,longrun) sddm
it start without any problems.I don't know if there is a solution for this problem or not or if it's easy to implement, but will be a super cool feature to have users tree that works with encrypted user home.