Copy it to my configuration.nix and switch upgrade
I get a message that my hash is wrong
I update the hash and redo switch upgrade and my unstable packages are updated
Relevant snippet from my configuration.nix file:
let
pkgsUnstable =
import
(builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/0d59e0290eefe0f12512043842d7096c4070f30e.tar.gz";
sha256 = "sha256:04a03ffnjc2y22460n01djgvqgkrnmm02kqhrlzpd3wwjjbz3bb7";
})
# ...
environment.systemPackages = with pkgs; [
# --- Group unstables together here, in alphabetical order
pkgsUnstable.calibre
pkgsUnstable.ghostty
I checked https://status.nixos.org now and looks like the current commit ID has build problems. How can I find the last commit ID that didn’t have build problems?
And is there a more efficient workflow to do what I am doing—sans using npins?
Just use the branch directly (nixos-unstable, not nixpkgs-unstable, since you’re on NixOS). It won’t advance if a channel blocker has a build problem.
If you don’t want to manually update hashes, you either add a new channel for the root user or you use npins. Otherwise you’ll still have to do steps 4-6.
npins exists precisely to give you a more efficient - and more easily automated - workflow, FWIW. You’re just manually running the steps the npins project does for you.
let
pkgsUnstable = import <nixos-unstable> {
inherit (pkgs) config overlays;
inherit (pkgs.stdenv.hostPlatform) system;
};
in
# ...
Do not use this kind of URL - use a specific commit, if using a URL at all. Otherwise, the hash will change out from under you and your config will break.
error: Failed to open archive (Unrecognized archive format)
Command 'nix-build '<nixpkgs/nixos>' --attr config.system.build.toplevel --no-out-link' returned non-zero exit status 1.
If you don’t want to use flakes or npins for automating updates, I suggest using channels. This will also download the tarball from NixOS foundation servers instead of GitHub, which has a bunch of nice benefits.
That’ll leave you with no user-specific channels, and the correct system channels. The downside of channels is indeed that you might end up accidentally only updating user channels, while your nixos config uses system channels, so keep an eye on your user channels and make sure they stay empty.