Sailfish OS update from Jolla
It is that time of year again! On behalf of Jolla, let me extend warm and heartfelt greetings to each and every member of the Sailfish OS Community.
In this season of joy and reflection, I find myself grateful for the incredible community that surrounds Sailfish OS. Your passion, dedication, and collaborative spirit have made Sailfish OS more than just an operating system — it’s a shared journey filled with innovation, friendship and passion. Let’s make Sailfish OS flourish together.
May the holiday season bring you moments of joy, peace, and connection with loved ones. As we sail through the year-end waters and approach a new chapter, let’s reflect on the achievements, challenges overcome, and the friendships forged within our community. Your contributions have been the wind in our sails, propelling Sailfish OS to new horizons.
Looking back at what we have accomplished, in the form of Sailfish OS releases, there were five: one major release (4.5.0) in the beginning of the year, followed by four smaller ones. While those smaller releases focused on bugfixes, they still added new features, e.g. CLAT, which makes mobile data work on IPv6 networks.
May the upcoming year be filled with exciting developments and fruitful collaborations! Together, let’s navigate the seas of technology, curiosity, and creativity. Wishing you all a festive holiday season and a New Year filled with prosperity, good health, and the boundless possibilities that lie ahead.
Once again big thanks to David Llewellyn-Jones (flypig) on discussing with community member Yann Büchau (nobodyinperson) and sharing community energy! It goes without saying that Damien Caliste (dcaliste) did a great job with this year’s last repository roundup. We’re happy to say Merry Christmas to everybody. Please enjoy whilst reading this fortnight!
Energy from the Community
NixOS is an interesting Linux distribution that’s been around for a while but seems to have picked up a lot of momentum recently. The twelth law of tech states that all aspiring software ecosystems must define themselves in three words. In the case of NixOS these three words are: reproducible, declarative, reliable. But it’s also a Linux distribution with both standard and mobile variants.
But readers of this newsletter are interested in Sailfish OS, so why would I be writing about NixOS? Apart from being a fully fledged Linux distribution, NixOS is built around a versatile package management system — the Nix Package Manager — that can be installed on other distributions. And that’s exactly what Yann Büchau (nobodyinperson) did recently on his Sailfish OS phone. He then went on to write about his experiences here on the forum.
So we thought we’d do our usual thing and ask Yann a few questions, hopefully get to understand what the Nix Package Manager is and why others might be interested in installing it on their phones as well.
Yann is a FOSS enthusiast and atmospheric scientist (a meteorologist) currently doing a PhD in environmental science about quantifying natural CO2 emissions from non-volcanic sources. As part of this he’s developing a low-cost sensor network and so knows all about integrating software and hardware together.
Here’s a picture that shows the sort of devices Yann builds. You can read more about his work in a couple of his publications that look at the Wireless Sensor Network he’s developing (link temporarily down at the time or writing) and their application to quantifying gas emitted from holes in the earth.
(from Büchau et. al (2022) (link temporarily down at the time or writing), licensed under CC-BY-NC)
I start by asking Yann to explain a little about his journey to Sailfish OS
I never had an Android, Windows or Apple phone. My first smartphone was a Samsung Wave II, after which I entered the mobile Linux space with a Nokia N9 (what a beautiful device!). I was already a Linux user in school, so having a Linux on my phone just felt good. After the N9’s end became clear, I bought a Jolla phone and was happy for many years with it. It died eventually and I got a Sony Xperia X and put Sailfish OS on it. At some point the old Android compatibility layer added too much friction, so I briefly used a Sony Xperia 10 where the experience was not so great, so I eventually switched to a Sony Xperia 10 III with Sailfish OS and am very happy until now.
Python is my main programming language, so being able to use that for Sailfish OS app development was a big motivation for me. Over time I developed some apps, notably OpenSenseFish, a rather basic client for your OpenSenseMap account and Hasher for deriving hashes/digests from text and files. I put those on OpenRepos along with their Python dependencies - a tedious process.
The tedious process of making his apps available also feeds in to his route to using NixOS. We’ll come back to that, but first let’s look at why Nix is important outside of Sailfish OS. Although Nix is already over 20 years old, it’s been gaining a lot of traction recently in scientific circles as a way to achieve reproducible research. I ask Yann why that’s important.
Reproducible research is a sustainable way forward in science, as for Free and Open Source Software. Humanity is not helped by monopolising knowledge such as the exact steps and materials needed to build something, be it software or a science chart. Especially for publicly funded research.
From a work-efficiency point of view, designing your (digital) research in a reproducible way helps you to work on different machines. I frequently switch machines (desktop, laptop, server, etc.) and without a system in place that keeps your working environment idential across those, you spend more time debugging reproducibility issues than doing actual research.
So how does Nix actually help with this? Probably it’s the “reproducible” part of that three word description, right? Everything in Nix is built from declarative .nix
configuration files which define not just how to build something, but also exactly what to build it from. Packages can be reproduced down to their last byte, because everything in the Nix stack is hashed. You can install multiple versions of the same executable on a device, but when building another packages, only the exact same ones that it was originally built with will be used. Yann explains.
Nix is also a programming language; it’s like JSON but with functions basically. The entirety of NixOS and all Nix packages are defined in that declarative language.
Because these nix expressions are declarative it means they’re pure functional without side-effects. In other words, they always evaluate to the same thing no matter what.
One can do everything in plain nix. But that’s not very interoperable so they’re still developing a standard for these nix expressions (”flakes”) so people can reuse them somewhere else. An output from one of these can be a program, a script, a shell environment with certain programs available, even an entire NixOS configuration, or even a Raspberry Pi image to burn on an SD card.
Yann shares an example of a nix flake he made to run a Python script (or open a shell with that script available) with a pinned Python version:
{
description = "LaTeX Reference Order Checker";
# importing other nix dependencies, versions are pinned
# in a flake.lock file
inputs = {
# all nix packages
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
# utilities
flake-utils.url = "github:numtide/flake-utils";
};
# define what this flake produces as output
outputs = { self, flake-utils, nixpkgs, ... }:
# make it work for all nix-known architectures
flake-utils.lib.eachSystem flake-utils.lib.allSystems (system:
let
pkgs = nixpkgs.legacyPackages."${system}";
launcherName = "latex-check-refs";
# A launcher using nix' Python which calls
# a Python script in this folder
launcher = pkgs.writeScriptBin launcherName
''${pkgs.python3}/bin/python ${./latex-check-refs} "$@"'';
in {
# > nix run gitlab:nobodyinperson/latex-check-refs
# will run that script with all its pinned dependencies
apps.default = {
type = "app";
program = "${launcher}/bin/${launcherName}";
};
# > nix develop gitlab:nobodyinperson/latex-check-refs
# will drop you into a shell with that script
# 'latex-check-refs' available
# Other arbitrary software that should be available can
# be specified here as well
devShells.default =
pkgs.mkShell { buildInputs = with pkgs; [ launcher ]; };
});
}
So Nix allows you to define environments with specific versions of specific executables that can build themselves from the ground up and which will give you exactly the same environment whenever and whereever you use them.
Now if that’s something that interests you, then it’s quite likely it will interest you on Sailfish OS. If you’re reading this and thinking “that’s not something that’s ever been a problem for me” then it could be that Nix isn’t the tool you’re looking for. For Yann, when he heard about it he immediately decided it was something that could be useful for him.
When I heard about NixOS this summer, I already eyeballed it and then there was the Tübix Linux day in my city here with a talk about it, and then I made the jump on my work PC to NixOS. It’s very different, but also very powerful; especially well suited for reproducible research, which I am interested in.
Then I noticed you can also use nix on non-NixOS machines (my laptop for example) and then it occurred to me, why not also have that on my phone? I was struggling really hard keeping the same CLI utilities available on my Xperia 10 III with Sailfish OS. GPG was outdated, I couldn’t use my keyring. I couldn’t use my password manager
pass
. I had to compile tmux and timewarrior myself, and do some weird downloading forgit-annex
. And and and. Nix seemed like the ideal way out of this. Nix’s whole point is to provide the exact same version every time. This smoothes my workflows immensely. I use my Sailfish OS as an extension to my laptops and desktops. Having the identical toolset available is crucial. With Nix, this works!
Maybe this has piqued your interest? If it has, you’ll be pleased to hear that trying out the Nix Package Manager on Sailfish OS is surprisingly straightforward. Yann has detailed the process on the forum. The process follows the official instructions but with some additional steps that are needed to mount a file to the /nix
path to work around the intentionally constrained root partition on Sailfish OS.
When I worked through the steps myself I ran into some difficulties and ended up installing the multi-user version, which also required me to install bash
. None of the steps were particularly challenging, but I’m not sure how easy it would be to reverse the multi-user install.
Once installed it’s possible to drop to a Nix shell from inside the Sailfish OS command line. This will give you a specific environment populated with a specific set of tools, all down to the specific versions in use. It’s all very straightforward and seamlessly integrated.
Yann highlights the fact that the Nix shell won’t interact with any of your existing Sailfish OS software unless you explicitly ask it to.
Nix packages are completely isolated from Sailfish OS and bring their own libraries. Sailfish OS doesn’t even know about the Nix-installed packages as they reside in non-standard locations. No danger here.
Unlike the sandboxing on Sailfish OS, Nix doesn’t use sandboxing for this, it’s all done by essentially setting up environment variables — $PATH
for example — so that only the Nix executables are used in a Nix shell, and with the Sailfish shell using all of the things it’s always used. But that means that you can also potentially get them all to interact with each other if you want to.
I haven’t tested it yet, but in theory there should be no problem setting a GUI app’s PATH to include the Nix path. The programs should just work. This could be used to use a more recent Python in an app or any other program, really.
GUI apps are also possible with Nix. For example, OpenSCAD (a 3D CAD program) from Nix does launch without any further config (using
nix-shell -p openscad --run openscad
). Touch input works and even the file selection dialog opens. Not in the Silica theme of course. Unfortunately, one does not get past that, I guess it’s some 3D graphics problem here. Some other programs I tried mostly complain about the compositor. I wonder why OpenSCAD doesn’t, but there is some potential here for bringing normal GUI apps to Sailfish OS. I could get Okular — the PDF viewer — to launch from an Apptainer once, and so does Okular from Nix. Touch works, scrolling, pinch-to-zoom works. No menu bar though and other small quirks, but hey!
Yann suggests this as something to try if you want to get a quick feel for the power of Nix. After running through the setup steps you can then run Okular just with the following.
nix-shell -p okular --run 'QT_SCALE_FACTOR=2 okular'
Are there other things Yann finds useful on his Nix empowered phone?
I find it pretty cool to get
pass
to work on Sailfish OS.
If this all sounds like fun to you, or could ease up your workflow, not just on your phone but across all your devices, then why not give Nix a try? For me, this highlights not just the power of Nix, but also the power of Sailfish OS. Because it’s a glibc Linux distribution with a fully working shell and root access for users who want it, we have access to this immense ecosystem of useful tools. All of this is accessible just by running a few commands on your phone. You won’t find such a usable mobile user interface underpinned by such a powerful open ecosystem, with the user in full control, in many other places.
Thanks to Yann for walking me thorugh Nix and NixOS on his Sailfish OS device. My plan for the Christmas break is to spend some time exploring Nix and all of the tools it provides, and maybe it’ll end up being a new fixture on my phone for 2024 as well.
Repository roundup
With the administrative situation of Jolla sorted out, the activity in the public repositories of Sailfish OS increased significantly in the last 15 days. pvuorela took care of long standing pull requests, closing old ones and accepting many of the Qt6 upgrades from neochapay and jmlich. mal also continued his large work of keeping the software stack up-to-date and is also testing an upgrade of GCC, fixing in advance what will break in other packages.
Communication services
-
libqofono
, Qt bindings for Ofono, neochapay updated the build system for Qt6. -
libconnman-qt
, QML bindings for the connection manager, mariuszmaximus proposed to add a cmake build system in parallel to the current qmake one. -
libqofonoext
, Qt bindings for specific Sailfish OS extension to Ofono, jmlich proposed to fix a broken value in an enumeration, using a 64 bits value while the specifications is clear that enumerations are using plain integers. -
bluez5
, the Bluetooth stack, acfbhytuiltyghrth partially backported a fix for the two recent CVEs. mal commented that a general update of Bluez should be preferable and may happen before the next Sailfish OS release. -
commhistory-daemon
, the daemon handling call and message history, pvuorela changed the reply method for SMS, switching to a inline text one.
Multimedia
-
nemo-qml-plugin-thumbnailer
, the QML bindings to get image thumbnails, jmlich updated the build system to support Qt6.
User interface
-
libprofile-qt
, Qt5 wrapper library for profiles, jmlich created adjustments to build with Qt6. -
nemo-qml-plugin-notifications
, QML bindings to the Freedesktop notification system, jmlich updated the code to support Qt6. -
transfer-engine
, the backend to allow sharing data between apps, pvuorela fixed an issue where a path is send through D-Bus but treated as an URL. -
ngfd
, the non graphical feedback daemon handling sound and vibration feedback, pvuorela fixed a race issue with the MCE plugin in case of quick stop and restart. -
libngf-qt
, Qt-based client library for Non-Graphic Feedback daemon, pvuorela ensured that events passed tongfd
still exist. -
lipstick
, the home screen code (open source parts), pvuorela introduced a new hint to be able to store the priviledge level of notifications.
Low level libraries
-
nemo-qml-plugin-models
, provides QML models for searching or filtering, jmlich adjusted the code for compilation with Qt6. -
nemo-qml-plugin-configuration
, QML bindings to access configuration values, neochapay proposed changes to get the package build with Qt6. -
qt-mobility-haptics-ffmemless
, a Qt plugin which provides haptic feedback via ffmemless ioctl, jmlich updated it to build with Qt6. -
sensorfw
, sensor framework, Herrie82 is working on making the changes for LuneOS accepted in SailfishOS. While these changes concerned newer versions of Qt, some also deal with how the package is built with libhybris. After some exchanges with mal, a simpler solution proposed by Tofee has been accepted. -
mlite
, the configuration storage library, pvuorela allowed to keep the priviledges of the calling process via D-Bus. -
gdbm
, GNU Database Routines, mal updated it to 1.23. -
squashfs-tools
, tools for the squash file system, mal updated it to 4.6.1. -
audit
, user-space tools for kernel auditing, mal updated it to 3.1.2. -
systemd
, a system and service manager, mal backported fixes for two issues of printing null pointer strings. -
cpio
, GNU archiving program, mal updated it to 2.14. -
p7zip
, some compression tools, mal followed Fedora changes and cleaned up the spec file used to build the package. -
kbd
, tools for configuring the console, mal updated it to 2.6.3.
Developer’s corner
-
mal is working on upgrading
gcc
to version 10. This implies to fix various new compilation issues:-
Use default copy assignment operator for KeyResult in
sailfish-secrets
and also in lipstick and in buteo-sync-plugins-social. -
Remove unnecessary copy constructor from Link in
sailfish-browser
. -
Allow uninitialized global variables in a common block in
dirmngr
and also ingnupg2
and in diffutils. -
Fix multiple definition of variable when using inet.h in
connman
.
-
Use default copy assignment operator for KeyResult in
-
libiodata
, a library for writing and reading structured data, neochapay implemented changes to support parallel installation of a Qt6-based version. -
abseil-cpp
, a C++ library designed to augment the C++ standard library, nephros proposed to update it as a dependency ofprotobuf
being itself required by various applications in Chum. -
check
, a unit test framework for C, mal updated it to 0.15.2. -
libglibutil
, a library extending GLib with convenient utilities, following an issue with hidden symbols when built with CLang, slava ensured that all (and only) required symbols are exported. slava also cleaned warnings due to issues with C cast in code. JamiKettunen replaced hard-codedpkg-config
calls with a variable, allowing cross compilation without fiddling with the PATH to find the proper cross architecturepkg-config
. -
libphonenumber
, a library for manipulating international phone numbers, mal proposed to upgrade it to 8.13.6.
Please feed us your news
This time we will not be pushing out a newsletter between Christmas and New Year. Instead you can expect the next newsletter to be published on the first week of 2024. If there are topics you would like to hear about then, please write a comment below! And please join the community IRC meeting next week.
Happy Holidays and Sail On!