Skip to content

Conversation

K900
Copy link
Contributor

@K900 K900 commented Aug 3, 2025

  • vendor calamares-nixos-extensions
  • remove all the /run hardcoding
  • remove run as non-root bullshit
  • drop patches:
    • 0002 - replaced with wrapper args
    • 0003 - no, we're not doing this downstream
    • 0004 - replaced with custom page + tiny patch
    • 0005 - too much effort
    • 0007 - upstream fixed this better
    • 0008 - we can just set it in the config instead

TODO:

  • does this actually fucking work
  • make commit history pretty
  • make unfree page look tolerable
  • late wrap calamares with extensions
  • fix pkexec nonsense
  • die

TODO (later):

  • figure out what the luks patch is for
  • upstream patches???

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

adriaandegroot and others added 30 commits June 12, 2020 12:28
Probably happened due to copy/paste mistake or something
[kaos branding] Fix broken link
Create a new module and branding targeted at the smartphone and tablet
use case. The installation process is significantly different from your
typical PC install:
* The UI must fit mobile screens, the amount of inputs visible on one
  screen must be reduced.
* Every input must be controllable with an on screen keyboard.
* Full disk encryption is done with GRUB in Calamares, but mobile
  devices use other bootloaders (u-boot, lk).
* Complex partitioning screens are not useful for most users, as the
  expectation is not that multiple OS can be installed next to each
  other.

It would be nice if the regular Calamares modules worked with mobile
devices eventually. But this can't be done in one step (and before that,
the QML <> QWidgets related refactoring should probably be completed?),
therefore let's add it to calamares-extensions first.

This initial version is far from perfect, but what is there works
reliably. It should give a good shared base to iterate upon.

Implemented screens:
* Welcome
* Lockscreen PIN
  Set the user password, but as numeric PIN. Because that is what the
  current generation of mobile friendly Linux DEs expects (Plasma Mobile
  and Phosh).
* SSH server: enable or disable
  To debug Linux distributions on phones, SSH is essential. Give
  advanced users the opportunity to enable it and casual users the
  option to skip this.
* Credentials for SSH server
  The SSH server has a dedicated user account with a stronger password.
  Users are encouraged to replace password auth with SSH key auth after
  the installation.
* Full disk encryption: enable or disable
* Full disk encryption password

Screenshots:
https://postmarketos.org/blog/2020/07/15/pinephone-ce-preorder/#installer-with-optional-ssh-server-and-encryption

There is no partitioning screen. The target partition, which will be
formatted and optionally encrypted is defined in mobile.conf as
targetDeviceRoot. It is expected that the installer OS will use this to
install to an empty partition on the same medium as the installer (SD
card or eMMC) as explained here:
https://wiki.postmarketos.org/wiki/On-device_installer

I ended up throwing everything into one module instead of several,
because of a Qt Virtual Keyboard bug:
https://gitlab.com/postmarketOS/postmarketos-ondev/-/issues/18

Based on, but adjusted to be distro-agnostic:
https://gitlab.com/postmarketOS/postmarketos-ondev/-/releases/0.2.1
[mobile] add mobile friendly module and branding
Find yamlcpp, even if it is named libyaml-cpp.so (with a dash) as it is
the case in Alpine Linux.
Depending on compiler version and Qt version, this may or may not
compile; typical errors look like this:

/usr/include/qt5/QtCore/qlist.h:471:35: error: use of deleted function 'QPair<const QStringList, const QString>& QPair<const QStringList, const QString>::operator=(const QPair<const QStringList, const QString>&)'
  471 |     else *reinterpret_cast<T*>(n) = t;
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/qt5/QtCore/qpair.h:49:8: note: 'QPair<const QStringList, const QString>& QPair<const QStringList, const QString>::operator=(const QPair<const QStringList, const QString>&)' is implicitly deleted because the default definition would be ill-formed:
   49 | struct QPair
      |        ^~~~~
There's no need to name calamaresui -- viewmodules get that
automatically -- and if it *did* need to be named, it would
be Calamares::calamaresui
Organize the screens into features and replace all navTo() calls with
hardcoded screen names with new navNext() and navNextFeature()
functions.
Skip whole features if a featureSshd (example for feature "sshd") or
smilar config key exists and is set to false.
Add featureSshd config key to hide related UI screens and skip related
logic in UsersJob.
[mobile] make sshd feature optional and related navigation refactoring
Fix a typo and make the "booleans we don't read from QML don't need
a signal" message generic with one example, but not with a listing of
all these booleans. Then we won't need to adjust this comment with each
new one.
Rename "enableButton" to "firstButton" and "welcomeText" to "mainText".
Don't create the user's job in MobileQmlViewStep::onLeave() anymore.
Instead, have Config::createJobs() and call that from
MobileQmlViewStep::jobs(), as suggested by Adriaan, and that's also how
it's done in the keyboard module in calamares.git. This allows getting
rid of m_jobs, and makes it less awkward to pass parameters to the job.

Related: calamares/calamares-extensions#6 (comment)
@K900 K900 requested a review from vlinkz August 10, 2025 06:52
@K900
Copy link
Contributor Author

K900 commented Aug 10, 2025

OK, so the portal trick doesn't actually work on GNOME, but I think we can combine the sudo trick with the portal trick to get a combined good trick.

Copy link
Member

@vlinkz vlinkz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Only thing not working now is keyboard changes on plasma6, but that's a harder issue to solve and probably needs better upstream support.

  • locale1 doesn't work because Failed to set keymap: Changing system settings via systemd is not supported on NixOS.
  • calamares kwin doesn't work because the kwin keyboard apply function checks root dirs (/root/.config) (and regardless ~/.config/kxkbrc doesn't exist by default)

@K900
Copy link
Contributor Author

K900 commented Aug 10, 2025

We should probably make the systemd side checks smarter for this, to be honest.

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Aug 10, 2025
@ElvishJerricco
Copy link
Contributor

ElvishJerricco commented Aug 11, 2025

What's up with the green/red/yellow icons?
bad-user-pass
They used to look like this. Notice the icons that were gone on the username, and of course the warning and error sign icons.
good-user-pass
Also the allow unfree screen lost its styling, but I dunno if we care.
bad-allow-unfree
Before:
good-allow-unfree

EDIT: Oh, also, I'm no longer able to e.g. use the enter key to hit the next button or other keyboard navigation like that.

All of this is the same in both GNOME and Plasma6.

@K900
Copy link
Contributor Author

K900 commented Aug 11, 2025

The icons are a qtsvg bug, there should be a fix in 6.9.2. The unfree page I rewrote entirely, it can definitely be made to look nicer.

Copy link
Contributor

@ElvishJerricco ElvishJerricco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as we don't think those icons are a problem, LGTM

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Aug 12, 2025
Copy link
Member

@emilazy emilazy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hate the browser pkexec thing but otherwise this seems good.

@K900 K900 merged commit 8baeaa3 into NixOS:master Aug 12, 2025
26 checks passed
@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 3+ This PR was reviewed and approved by three or more persons. and removed 12.approvals: 2 This PR was reviewed and approved by two persons. labels Aug 12, 2025
@philiptaron
Copy link
Contributor

philiptaron commented Aug 16, 2025

This PR causes the size of the nixpkgs tarball to grow by 10MB.

$ gh api /repos/nixos/nixpkgs/tarball/$(git rev-parse 8baeaa3e949e52844b9cfda86af3c8cc1829dcd5^) | wc -c | numfmt --to=iec --suffix=B
44MB
$ gh api /repos/nixos/nixpkgs/tarball/$(git rev-parse 8baeaa3e949e52844b9cfda86af3c8cc1829dcd5) | wc -c | numfmt --to=iec --suffix=B
54MB

In particular, it's commit 917eb19 that does so.

@K900
Copy link
Contributor Author

K900 commented Aug 16, 2025

It's the assets, presumably. We might want to JPEG those.

@K900
Copy link
Contributor Author

K900 commented Aug 16, 2025

#434243

@raboof raboof mentioned this pull request Aug 18, 2025
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 3+ This PR was reviewed and approved by three or more persons. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.
Projects
None yet
Development

Successfully merging this pull request may close these issues.