How to pin a single software to a specific version when using home-manager

Hey all,

this comes up due to Build failure: python311Packages.sphinxcontrib_newsfeed · Issue #263504 · NixOS/nixpkgs · GitHub and I tried to find a way to keep khal to a working version while keeping everything else up to date.
khal seems to be installed via some home-manager modules. I therefore need to find a way to change the khal version for the complete setup.

I’m not using flakes but channels.

I tried to follow Nix Package Versions and came up with the following as an overlay

self: super: {
  khal = (import (builtins.fetchTarball {
    url = "https://github.com/NixOS/nixpkgs/archive/9957cd48326fe8dbd52fdc50dd2502307f188b0d.tar.gz";
  }) {}).khal;
}

but this results in the following error:

unpacking channels...
/home/daniels/.nix-profile/bin/home-manager: line 514: 306493 Killed                  nix-build "<home-manager/home-manager/home-manager.nix>" "${extraArgs[@]}" "${PASSTHROUGH_OPTS[@]}" --argstr confPath "$HOME_MANAGER_CONFIG" --argstr confAttr "$HOME_MANAGER_CONFIG_ATTRIBUTE"

Would be cool to have an easy way to pin certain software to latest working version while keeping everything else up to date.

1 Like

Yes, I’ve been struggling with a good answer to this question myself. If one is using flakes having a separate pinned input is possible, but it does feel like a rather ugly solution.

1 Like

Just found an issue for nix.dev to add a tutorial regarding specific package version [1]

It links to an overview (not sure if it’s complete) [2] describing different approaches.

[1] Using a specific package version · Issue #490 · NixOS/nix.dev · GitHub
[2] Feature request: Display Nixpkgs revs for prior package versions · Issue #636 · NixOS/nixos-search · GitHub

1 Like