Jump to content

FAQ/Pinning Nixpkgs: Difference between revisions

m
no edit summary
imported>Profpatsch
(Move the unstable service section down, since it is less relevant to most people than general nixpkgs pinning)
mNo edit summary
 
(6 intermediate revisions by 4 users not shown)
Line 3: Line 3:
separately on their own terms, and to ensure their deployability is
separately on their own terms, and to ensure their deployability is
not impacted by other systems' requirements.
not impacted by other systems' requirements.
Another reason why one would want to pin nixpkgs is to get older versions of a specific software. [https://lazamar.co.uk/nix-versions/ This site] can show you all the versions a package went through, and what nixpkgs revision to use to get your specific version.
Note: You can <code>sudo nix-channel --remove nixpkgs</code>, but you still need a nix-channel for nixos
<pre>
sudo nix-channel --list
nixos https://nixos.org/channels/nixos-21.05
</pre>


== Nix 2.0 onwards ==
== Nix 2.0 onwards ==
Line 148: Line 157:
How to upgrade a single package and service to an unstable version
How to upgrade a single package and service to an unstable version


There is probably a better way, especially once flakes comes around. Some packages, let you specify which <code>package</code> to run as an option for instance.  Most don't in my experience. This is how you do it for one that doesn't.
There is probably a better way, especially once flakes come around. Some packages let you specify which <code>package</code> to run as an option but most don't. The following is a generic way that also works for those which don't.


add to configuration.nix a set allowing unstable packages.
add to configuration.nix a set allowing unstable packages.
Line 223: Line 232:
where all the stuff just comes from the bind services definition(which you can get from the source link on the nixos options page.)
where all the stuff just comes from the bind services definition(which you can get from the source link on the nixos options page.)
Just replace named variables, and replace <code>${pkgs.bind.out</code> with <code>${pkgs.unstable.bind.out}</code>
Just replace named variables, and replace <code>${pkgs.bind.out</code> with <code>${pkgs.unstable.bind.out}</code>
== See also ==
- [https://nix.dev/reference/pinning-nixpkgs Pinning Nixpkgs]
- [https://nix.dev/tutorials/first-steps/towards-reproducibility-pinning-nixpkgs Towards Reproducibility: Pinning Nixpkgs]
- [https://nix.dev/guides/recipes/dependency-management.html Dependency Management]