Is there a best practice for pinning a handful of packages, for instance whose builds are currently broken in nixpkgs-unstable
, while using the unstable channel for all other packages? (I’d prefer not to roll back all of nixpkgs, as making use of some recent changes to other packages.)
I’ve seen it mentioned (e.g. here) that this is possible, and have tried to replicate this example with something like the following overlay:
self: super:
let
nixpkgs = { rev, sha256 }:
import (super.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
inherit rev sha256;
}) { config.allowUnfree = true; };
last-good-neovim = nixpkgs {
rev = "81461cff5f540c92e5030f62b89ee7b64e85c6df";
sha256 = "1kpbw9l69ih9qm143vqpja0njg8fll7jrkph01hqyckm1bnxaljr";
};
in {
inherit (last-good-neovim) neovim-unwrapped;
}
However, with this added to my overlays, nix-env -iA nixos.neovim
will hang and consume all available memory, hinting to me that something is wrong (unbounded recursion?) Actually, the same behavior happens with any nix-env
command, as far as I can tell, when the above overlay is added.
My questions are
- Is there a better practice for pinning a package definition (or set of definitions) to an older nixpkgs hash?
- Is there an obvious issue with the above that would explain why
nix-env
commands seem to choke when it’s added as an overlay?
nix-info -m output:
- system:
"x86_64-darwin"
- host os:
Darwin 19.3.0, macOS 10.15.3
- multi-user?:
yes
- sandbox:
no
- version:
nix-env (Nix) 2.3.3
- channels(matt):
"darwin, home-manager"
- channels(root):
"nixpkgs-20.09pre216412.04d6123309f"
- nixpkgs:
/nix/var/nix/profiles/per-user/root/channels/nixpkgs