a link shortener for Nixpkgs is a small service that allows you to use short URLs when referring to a package or an option on NixOS Search! For instance, instead of sending, you can now send

Here are the currently available routes:

  • /:package (defaults to unstable channel)
  • /:channel/:package
  • /option/:option (also defaults to unstable)
  • /option/:channel/:package

This project is open source on GitHub at ryanccn/nixpkgs-dev!


Looks nice ! Do you plan to add a ‘clic to copy short link’ button to ?

Maybe we could request @qyliss a redirect from .gs :blush:

I already did via email!

1 Like

Wow, awesome! Is it possible to add e.g. position/:package which links to the 📦 Source on, i.e. the meta.position of a package?

For example, position/comma can redirect to

I thought about adding this feature in the initial release, but there are various technical difficulties with adding such a feature:

  • Evaluating Nixpkgs is slow, so uncached meta.position queries would result in somewhat slow redirects
  • A separate traditional server backend would have to be added in order to call Nix directly
  • It might not be wise to rely on NixOS Search’s internal Elasticsearch instance since there might be breaking changes

Yeah, I was not thinking about evaluating nixpkgs, rather I was thinking about parsing the first result on, and get the 📦 Source provided there. But as you have pointed out above, this would be an incredibly fragile operation… Indeed, better not to do it unless there is a stable API.

no thanks, if for any reason the service stops working, so will do your links…

do you want some top-level subdomain * for this? :slight_smile:

Such logic can also be hosted on Cloudflare for free though

1 Like

I assume the domain requires a subscription.