❄️ Installing the nix package manager on SailfishOS

You might be able to install packages that otherwise wouldn’t be available on SailfishOS. I have the idea of installing ProtonMail Bridge through Nix, for example. This app won’t run on SailfishOS (apparently due to missing dependencies?)

1 Like

it’s enough to just prepare a spec file for it for sfos.

@lolek If you don’t see the gigantic benefits of having nix on SailfishOS, then I guess it is not for you, because you haven’t yet run into a situation where you needed it.

Sure, there is pkcon and zypper on SailfishOS. But good luck installing anything recent or custom with it. The jolla repos contain what’s necessary to run the OS, not more. Many of the core tools are outdated. GnuPG is extremely out of date, due to licensing issues IIUC. Want to use tmux? You have to use some random build off OpenRepos that doesn’t work. Or breaks after the next update. Same for all the Python stuff. Same for other shells like fish. The list is infinite, as there is a quasi infinite amount of new software being made that’s just not in the jolla repos or openrepos. Packaging dependencies and software for OpenRepos or elsewhere is very tedious in my experience. And outdated fast.

With nix, there’s a gigantic community packaging pretty much everything. You don’t have to do it. Nix packages will just work across SailfishOS updates. They are self-contained. With nix you can get proper up to date encryption tools (see my GPG example above).

For me, having a Linux phone is about sharing workflows and tools across machines. I do time tracking from the terminal with timewarrior and can amend it from the phone. I manage my finances with hledger and can emergency-analyse it on the phone. I sync files with git-annex and can have my phone be part of it. The list goes on. All of this is so much easier now with nix. I had to package or build everything myself before. Now I don’t and it’s awesome. :smiley:

7 Likes

Thanks for the hints. I added a warning about the download size to the post.

As for the Determinante Systems installer I don’t think that it’ll bring much value here (though I haven’t tried). It can’t work around the small root partition problem. And here, we’re using the single-user installation without the daemon and builder users etc. This is ideal for this effectively single-user SailfishOS and also easy to remove. No real need for the new installer’s fancy install receipt to make sure everything can be removed cleanly again. But I’d be happy to hear what your experiences with it are on SailfishOS.

Sadly in my life I had the oportunity to work with nix and nixos and honestly I see literaly zero benefits and more negative problems with it on SailfshOS. One of the biggest is the space requirements, second is the learning curve for newcomers.

Well then, easy solution for you: don’t use nix on SailfishOS. :smiley:

2 Likes

Wait, really? Last time, I tried to build ProtonMail Bridge from source and failed because some dependencies weren’t available on Sailfish.

Hi,

I am interested in this! Did you manage to get ProtonMail Bridge working with Nix?

I did! But something I did with Nix messed up my sytem (bootloop), so I undid it again.

But I had the idea of installing the Nix packagr manager in an LXC container and running Bridge from there which now works perfectly!

Really? :astonished: I wonder how that is possible. At least from my instructions here I don’t see a possibility that could affect base SFOS, let alone causing a boot loop. If you remeber what caused it, I can add it as a warning to the post.

Thanks for the guidance, I feel more confident to try it now.

I will post a tutorial how to setup ProtonMail Bridge on sailfishos.wiki if you are interested

3 Likes

I’m not sure what caused the problem. I first thought it was the systemd-service I created to mount /nix when booting up (because I reboot my device every day). But after I removed it, the problem appeared again. I discovered that it basically gets to the unlock prompt and after you type in the code it doesn’t do anything. It does this two or three times if you reboot and then it boots again normally. I have now removed nix and it hasn’t done this since then. So I assume that nix was somehow the problem? But I really can’t think of anything that nix could do to cause this

1 Like

That would be perfect, thank you in advance! I have no idea how many ProtonMail users there is out here, but the support for it has been missing from SFOS for too long time.

Alternative option for what?? I’m already a ProtonMail Plus subscriber and I already use Bridge on my Laptop and now on my phone

Fine and it is also fine that you share your know-how with a wiki tutorial. Just remember that it such a service require a monthly subscription (or year or multi-years subscription). Nothing bad about that and I like Proton services. However, it always important to consider a open-source alternative.

Why? For the same reason (vendor lock-in) you are struggling with SFOS, for example… :wink:

As far as I can tell, Proton’s services are open source in most parts:

With E-Mails, you basically always have “vendor lock-in” except if you host your own E-Mail-Server, which many of us don’t have the resources or the knowledge for.

1 Like

Here is the tutorial I promised: Using ProtonMail Bridg... | SailfishOS community wiki

6 Likes

Oh did we? Then I’m sorry, I misunderstood your point.

You are right, you can absolutely host your own E-Mail server at a hosting provider. What I meant was really hosting it by yourself (e. g. on an old computer in your basement,…)

Thanks for sharing this @NIS, great that you got it working and a really nice write-up.

2 Likes