I would like to know the general approach on how to install a newer version of a package than the version in nixpkgs. The Nix(os) documentation seems to suggest overlays for that but I couldn’t get it to work.
My approach is to have a local checkout of the git repository and build on top of that. This makes it easy for me to open PRs each time I update a package I need.
at first in addition to the overlay I had tilt added in environment.systemPackages but the overlay didn’t seem to have any effect. Running
tilt version
would just give: 0.22.15. So I don’t know how to install it in case you have an overlay.
I also experimented with a local git clone of nixpkgs and adding my changes to tilt there but I don’t know how to install from that local repository either.
If you have a local tarball file or directory,you can just add the path of the newer tilt package or directory into the src attribute. And the name or version attribute also needs to be modified
.
Hi @cab, thanks but what do you mean by “add it in config”?
@hrx okay got it. Here I prefer to fetch it from github and keep the overlay close to the code in nixpkgs to create a PR once I can confirm tilt is working correctly.
What I do is have a directory (called nix-system) in which I clone nixpkgs and other nix repositories I need (i.e., home-manager, emacs-overlay and nixos-hardware). Then, I make my NIX_PATH point to this directory:
$ echo $NIX_PATH
/home/cassou/nix-system
When asked for <XXX>, nix will take the XXX directory of /home/cassou/nix-system. As a result, <nixpkgs> resolves to /home/cassou/nix-system/nixpkgs which is exactly where the git clone of the nixpkgs project is.
where nixpkgs repo is cloned to ~/nix-system/nixpkgs. I had to use the -f option otherwise it still installed the version of tilt from upstream. I am not completely sure what the -f option does but it seems to stand for path and will search for a folder nixpkgs in the NIX_PATH.