I make use of the makemkv package to rip physical media for my Jellyfin instance. Currently, this package fails to build, as the server gives an incomplete .tar.gz file, which fails to extract.
As a result, all attempts to update my system fail:
I do not wish to uninstall makemkv, as it is essential for adding to my digital media library.
I do not want to be stuck on an outdated system while I wait for MakeMKV to fix their servers.
Hypothetically, there should be no reason to rebuild makemkv at all, as my system is already running the latest version, 1.18.3, which should be clear from nixpkgs.
As such, how can I skip the updating of this one package without removing it entirely?
Nix considers it a different derivation if any buildtime or runtime dependency (or transitive dependency) has changed in any way whatsoever. Only the tendencies of programmers not to do crazy things keeps it from actually behaving quite differently when built with different dependencies and build tools, even if it is the same version. This is actually important behavior to get the reproducibility nix aims for. (Take, as an example, the xz trapdoor in openssh a while back. It was a trojan horse that changed the behavior of sshd when it was linked against a certain version of xz.)
“Skip updating” is a phrase firmly rooted in the kind of package management NixOS does not do. That is, stateful package management. For NixOS, it’s trying to build a system from scratch on every update. Sometimes it finds it “happens” to already have a lot of the stuff it needed, but that’s what it’s doing in principle.
Thus, what you need to do is change the definition you’re using, to specifically install that package from another version of nixpkgs. If that would even help in your case. I haven’t looked into the root cause of the issue. At the least, installing it from the last version of nixpkgs you built from should work, if only by caching.
Unfortunately, I don’t have any versions cached, and since the application is closed-source, it isn’t cached by NixOS. As such, any attempt to change nixpkgs versions runs into the same issue. So while your explanation makes sense, it is sadly unhelpful for my situation.
Fortunately, I found an alternative workaround, which is to include my existing build from the nix-store in my packages list:
environment.systemPackages = with pkgs; [
# Currently, MakeMKV servers are down, meaning that rebuilds would fail due
# to attempting to download the makemkv-bin-1.18.3.tar.gz file, and
# receiving an incomplete and corrupted copy. As such, I am directly
# referencing the installed package in order to avoid rebuilding the
# existing package.
# makemkv
(builtins.storePath "/nix/store/7rr30kilhbac4s86zy27s5xc756a5dm9-makemkv-1.18.3/")
];
I should be able to change it back to the normal version as soon as MakeMKV sort out their servers.
You have the version already in your nix store as part of the generation you’re currrently running, though. If you use the same commit of nixpkgs that was built from, it should reuse it.
This… is a fairly bad idea, generally speaking. But if you only keep it for a few days, problems are unlikely. I suppose it’s better than not being able to update? Probably?
As a general rule, any time you manually put a store path into any permanent file, you’re almost certainly making a big mistake. In this case, though, I believe the only issue is that your configuration will no longer be buildable on a machine that does not already have that store path. Probably nothing else.
Unfortunately, the version from the generation I’m running is from nixpkgs-unstable. v1.18.2 had a bug under Gnome on NixOS, and I switched to the unstable branch to see if v1.18.3 fixed it, and then forgot to switch back. I imagine that finding the nixpkgs-unstable version it was built from would be quite difficult, since most of my packages are from nixpkgs-25.11.
Whether this is the intended way to mix-and-match between stable and unstable is another question (alternative suggestions are welcome), but it seems to work. I mainly use it to get updated versions of fast-moving software such as zed-editor and vscode.
Unpinned inputs! Arg. This is exactly why you shouldn’t do that! (Also, I now understand the urgency of the problem for you. You can’t even make a change to your system because of this.)
Add another channel for it so you control the updates to unstable as well, and can roll them back if desired. That would at least let you rebuild to make changes, even if you couldn’t advance to a new nixpkgs without breaking something.
Thanks for the advice. For now I’ll just stick to manually adding the channel, since it turns out that works nicely with my little update script. Thanks so much for all the advice!