New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
examples/phosh-demo: init #352
Conversation
systemd.defaultUnit = "graphical.target"; | ||
systemd.services.phosh = { | ||
wantedBy = [ "graphical.target" ]; | ||
serviceConfig = { | ||
ExecStart = "${pkgs.phosh}/bin/phosh"; | ||
User = 1000; | ||
PAMName = "login"; | ||
WorkingDirectory = "~"; | ||
|
||
TTYPath = "/dev/tty7"; | ||
TTYReset = "yes"; | ||
TTYVHangup = "yes"; | ||
TTYVTDisallocate = "yes"; | ||
|
||
StandardInput = "tty-fail"; | ||
StandardOutput = "journal"; | ||
StandardError = "journal"; | ||
|
||
UtmpIdentifier = "tty7"; | ||
UtmpMode = "user"; | ||
|
||
Restart = "always"; | ||
}; | ||
}; | ||
|
||
services.xserver.desktopManager.gnome3.enable = true; | ||
|
||
# Unpatched gnome-initial-setup is partially broken in small screens | ||
services.gnome3.gnome-initial-setup.enable = false; | ||
|
||
programs.phosh.enable = true; | ||
environment.systemPackages = [ terminal ]; | ||
environment.gnome3.excludePackages = with pkgs.gnome3; [ | ||
gnome-terminal | ||
]; | ||
|
||
environment.etc."machine-info".text = lib.mkDefault '' | ||
CHASSIS="handset" | ||
''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't most of this be part of a configuration option in upstream NixOS?
Relatedly, maybe, can this be done through a display manager?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hostnamectl reads /etc/machine-info, but only if it cannot find the chassis type via another method such as SMBIOS (?) or the device tree.
Fortunately, https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git/commit/?h=sunxi/for-next&id=d900a1cd310de097fb94796ca575c118b2637b3b adds the chassis type for Pinephones. We just have to wait until the sunxi maintainers merge that into mainline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or we can fetchpatch
it / add it as needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't most of this be part of a configuration option in upstream NixOS?
See NixOS/nixpkgs#153940 for a PR to add the Phosh systemd service.
I did try to add this to a config to get phosh running, but everything seems crashy. Not sure what I'm doing though... (phoc already crashes with some vague errors, and I really don't understand desktop managers well enough). Have not tried this as-is though, maybe that works better. |
users.users.${defaultUserName} = { | ||
isNormalUser = true; | ||
# Numeric pin makes it **possible** to input on the lockscreen. | ||
password = "1234"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about users.users.<name>.hashedPassword
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not meant for actual use. This is meant more of an example configuration you can look at as a starting point.
Including this in your system configuration is foolish :).
We probably should make this more obvious in some way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had some clashes with user names and identifiers while upgrading profile from the xfce demo. Had to change user name to "nixos" and id to 1001 (in several places) to make it start.
i got an error:
|
@genofire you can't cross-compile this, you have to use the same system (e.g. use aarch64 to compile for aarch64) You try using QEMU via the binfmt wrapper: https://nixos.wiki/wiki/NixOS_on_ARM#Compiling_through_QEMU And then hack up the config to override the system:
This works for me to compile the original demo. |
in case anyone needs a bit of help adapting this into an example config (I did), I have a demo repo which builds for pinephone: https://github.com/mhuesch/pinephone-mobile-nixos-flake-example all credit for actual implementation due to @zhaofengli & the mobile-nixos contributors 馃檪 馃檱 |
It works on my pinephone, good work. on first look i miss also feedbackd (but maybe i overseen it) |
I tested it briefly, and it works. I think, this PR will lower the MobileNixos entry level significantly, from "space-high" to somewhere like "a hard quest" ;) The one significant issue is the on-screen keyboard. I can't see it at all, had to plug the desktop keyboard in. Will try to figure out what is wrong with it. |
Yeah, I should rebase and get this merged soon.
For the on-screen keyboard, you may need to toggle the docked mode in the quick settings. |
a520102
to
6c6ed9b
Compare
New version of PR doesn't build for me because of a missing url
|
6c6ed9b
to
8987a6f
Compare
8987a6f
to
9d2679a
Compare
Oops, accidentally added a stray commit. Fixed. |
@zhaofengli you can drop a commit when rebasing. https://stackoverflow.com/a/37311746/2611995 |
Yes, I know and have dropped it. I had an extra commit on master (an old version of #452) and didn't notice when rebasing interactively. |
With NixOS/nixpkgs#153940 finally merged, it makes sense for that to be used instead of manually defining a service. Let's merge #468 instead. |
A very simple Phosh demo image with the full default GNOME app set, with gnome-terminal replaced by kgx. Not very exciting as many apps are broken on mobile 馃槙
Librem has a GTK patchset which you can apply with my overlay (not included).
Screenshot