I want to install tutanota-desktop
from the unstable repo, since it has no maintainer and it’s never ported to stable. All tutorials I found involve flakes, which I don’t know how to use, and are very complex. Is there a simple and easy way to cherry pick packages from unstable?
Well, if you’re not using flakes, you’re presumably using channels. Add a channel for unstable:
sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos-unstable
Note the sudo
, you need to add this to the root user’s channels, not your user’s channels. Also make sure to use sudo
when updating your channels.
Then you can use that in your configuration where you define your packages (or get creative with your nix expressions, this is just for illustration):
{
environment.systemPackages = let
pkgs-unstable = import <nixos-unstable> { };
in [
pkgs-unstable.tutanota-desktop
];
}
That said:
Those things don’t necessarily have much to do with each other. Whether something is backported just depends on if someone creates PRs for it, and whether those updates are in fact backwards-compatible. You could take over that task yourself if you so wished.
Can this be done declaratively?
That’s a major part of why flakes exist. That said, you’re already using channels, this isn’t any less declarative than what you already have.
The main alternative to flakes that accomplish something similar is niv. Please don’t listen to the people who might tell you to manually fetchurl
, that way footguns lie.
I understand
Don’t worry, that seems way too complicated for my understanding (I’m a noob).
In the end giving one imperative command when installing the OS is not that bad, I already have to install Flatpaks that way, but it is less clean for sure. Thank you
Way too over my head
I was hoping to find an option like system.unstable-repo.enable = true
No, mixing stable and unstable isn’t supported nor recommended.