nixpkgs/pkgs/by-name
2024-07-21 06:01:25 +00:00
..
_0/_0xpropo
_2/_2ship2harkinian
_4
_6/_64gram _64gram: 1.1.30 -> 1.1.31 2024-07-18 02:04:57 +00:00
_9/_9base
a4/a4
a5/a52dec
aa
ab
ac
ad adafruit-nrfutil: remove nose and modernize 2024-07-14 17:30:31 -04:00
ae aerc: 0.18.0 -> 0.18.1 2024-07-16 14:56:38 +12:00
af affine: 0.15.2 -> 0.15.6 2024-07-18 12:04:09 -03:00
ag
ai
al alpaca: init at 0.9.6.1 2024-07-19 23:56:39 +08:00
am
an Merge pull request #328137 from Pandapip1/init-android-studio-tools 2024-07-21 02:40:16 +03:00
ao/aocl-utils
ap application-title-bar: add passthru.updateScript 2024-07-14 20:41:07 +00:00
ar arrow-cpp: 16.0.0 -> 17.0.0 2024-07-18 17:11:50 +02:00
as ascii-draw: 0.3.4 -> 0.4.0 2024-07-15 17:26:00 +08:00
at atlauncher: 3.4.36.9 -> 3.4.36.10 2024-07-15 12:51:51 +04:00
au Merge master into staging-next 2024-07-21 06:01:25 +00:00
av
aw awscli2: 2.17.5 -> 2.17.13 2024-07-18 07:06:31 +00:00
ax
ay
az azure-cli-extensions.vm-repair: 1.0.6 -> 1.0.7 2024-07-17 18:14:16 +02:00
ba Merge staging-next into staging 2024-07-19 12:01:49 +00:00
bc bcachefs-tools: 1.9.3 -> 1.9.4 2024-07-19 12:38:03 +00:00
bd
be Merge pull request #327080 from Aleksanaa/fetchgit-sha256-fix 2024-07-14 20:56:04 +08:00
bi Merge staging-next into staging 2024-07-19 18:01:40 +00:00
bk/bk
bl Merge branch 'staging-next' into staging 2024-07-16 19:07:48 +03:00
bm/bmake bmake: 20240625 -> 20240711 2024-07-15 01:03:17 +00:00
bn/bngblaster
bo
bp Merge pull request #327053 from martinetd/bpftrace_0_21 2024-07-19 14:36:33 +02:00
bq/bqn
br brainflow: Remove with lib 2024-07-18 05:37:22 -04:00
bs
bt
bu bustle: use gettext from nixpkgs 2024-07-20 09:19:01 -04:00
by
c-
c2 c2patool: 0.9.4 -> 0.9.5 2024-07-19 02:06:11 +00:00
ca Merge branch 'staging' into staging-next 2024-07-20 16:12:24 +02:00
cb
cc
cd
ce Merge branch 'staging' into staging-next 2024-07-20 16:12:24 +02:00
cg
ch Merge pull request #327555 from r-ryantm/auto-update/chezmoi 2024-07-16 21:15:20 +00:00
ci
cl Merge pull request #324244 from Guanran928/clash-verge-rev 2024-07-21 13:55:15 +08:00
cm Merge #323286: cmake: fix file fixing process 2024-07-20 09:42:16 +02:00
cn/cntb
co Merge master into staging-next 2024-07-20 18:01:23 +00:00
cp
cq/cq
cr
cs csvkit: 2.0.0 -> 2.0.1 2024-07-18 23:38:35 +00:00
ct/ctx
cu python312Packages.typer: include standard optional 2024-07-18 18:54:10 +02:00
cv/cvemap
cy
cz/czkawka
da Merge pull request #323877 from Luflosi/update/darling-dmg 2024-07-15 22:40:06 +05:30
db
dc
dd ddns-updater: Add module, test, update script 2024-07-17 21:56:05 +00:00
de decker: 1.45 -> 1.46 2024-07-18 08:49:00 +00:00
dg/dgoss
dh/dhcpig
di Merge staging-next into staging 2024-07-19 18:01:40 +00:00
dj/djent
dm
dn
do Merge pull request #327574 from r-ryantm/auto-update/dopamine 2024-07-19 10:49:02 +00:00
dp
dr
ds
dt
du dust: 1.0.0 -> 1.1.0 2024-07-17 01:01:31 +00:00
dv/dvb-apps
dx
dy
e1/e1s
ea
eb
ec
ed Merge #323718: ed: a huge refactor 2024-07-20 09:46:44 +02:00
ee/eepers
ef/efibootmgr
ei
ej/ejsonkms
ek/eksctl eksctl: 0.184.0 -> 0.186.0 2024-07-14 07:44:36 +00:00
el
em empty-epsilon: move to pkgs/by-name 2024-07-14 21:22:12 +02:00
en envision-unwrapped: 0-unstable-2024-06-25 -> 0-unstable-2024-07-03 2024-07-15 05:43:18 +00:00
eo/eog
ep
er
es
et
eu
ev evil-helix: 20240618 -> 20240716 2024-07-17 00:25:24 +00:00
ew/eww
ex
ey/eyewitness
ez/eza eza: 0.18.21 -> 0.18.22 2024-07-18 06:38:54 +02:00
f2/f2fs-tools
fa treewide: remove dtzWill as maintainer [orphans] 2024-07-17 13:52:45 -03:00
fb/fbset
fc fcitx5-pinyin-moegirl: 20240609 -> 20240709 2024-07-19 18:13:02 +08:00
fe
ff
fg/fgqcanvas
fi files-cli: 2.13.85 -> 2.13.96 2024-07-19 20:50:55 +00:00
fj/fjo
fl Merge pull request #325938 from pbsds/bump-flexget-1720558165 2024-07-20 15:53:37 +02:00
fm
fn/fnott Merge pull request #318401 from jmbaur/fnott-1.6 2024-07-18 01:56:11 +02:00
fo
fr tree-wide: use top-level cctools 2024-07-17 22:36:19 -04:00
fs
ft/fte
fu
fv
fw/fwupd
fx/fx
fy/fypp
fz fzf: cleanup 2024-07-19 11:47:28 +02:00
g3/g3kb-switch
ga
gb
gc
gd
ge geographiclib: migrate to by-name 2024-07-15 13:43:24 +04:00
gf
gg/gg
gh
gi gitu: 0.22.1 -> 0.23.0 2024-07-19 02:22:39 +00:00
gl
gm
gn gnome-font-viewer: fix build with clang 16 2024-07-20 08:58:32 -04:00
go Merge staging-next into staging 2024-07-19 12:01:49 +00:00
gp
gr grype: 0.79.2 -> 0.79.3 2024-07-16 05:20:42 +00:00
gt
gu
gv/gvisor
gx/gxml
h5/h5utils h5utils: remove more 'with lib' 2024-07-14 14:09:56 +02:00
h8/h8mail
ha Merge pull request #327455 from getchoo/pkgs/hadolint-sarif/0.5.0 2024-07-19 15:58:56 +02:00
hb/hb-honeypot
hd
he
hi
hj/hjson-go
hn/hn-text
ho home-manager: 0-unstable-2024-07-05 -> 0-unstable-2024-07-11 2024-07-15 10:01:53 +00:00
hp/hpp2plantuml
ht
hu
hv/hvm
hy hyprspace: reinit at 0.10.2 2024-07-16 09:20:50 -04:00
i2/i2p
i3 i3pystatus: applying fixes from reviews 2024-07-16 11:43:55 -03:00
ia
ic treewide: sha256 -> hash attribute for fetchgit 2024-07-14 19:10:08 +08:00
id
if/ifrextractor-rs
ig Merge pull request #327002 from r-ryantm/auto-update/igir 2024-07-19 20:57:08 +02:00
ii
ij/ijhttp
im Merge pull request #327245 from r-ryantm/auto-update/immich-go 2024-07-16 21:36:13 +00:00
in Merge pull request #326620 from bbigras/incus 2024-07-15 14:47:18 -04:00
io
ip
ir Merge pull request #300812 from loco-choco/irpf-update-script 2024-07-21 01:09:14 +02:00
is
it
iv/iverilog verilog: rename to actual name iverilog 2024-07-15 08:36:13 -07:00
iw/iw
iz/izrss
ja Merge #319221: jansson: adopt; modernize; add more checks 2024-07-20 09:29:30 +02:00
jd/jdt-language-server
je
ji
jj/jj
jn
jo
jq/jq-zsh-plugin
jr/jrl-cmakemodules
js
jt/jtdx
ju Merge pull request #328349 from mfrw/mfrw/just-1.32.0 2024-07-19 19:15:42 -04:00
jw/jwasm
ka
kc
kd
ke keymapp: 1.3.0 -> 1.3.1 2024-07-14 19:37:23 +02:00
kg/kgeotag
ki
kl/klog-time-tracker klog-time-tracker: 6.3 -> 6.4 2024-07-17 00:58:35 +00:00
km
kn
ko Merge pull request #328413 from DontEatOreo/interface-backport-koboldcpp 2024-07-20 19:33:15 +03:00
kp/kplex
kr Merge pull request #325223 from mweinelt/typer-deps 2024-07-18 18:54:53 +02:00
ks
kt
ku
kv/kvmarwaita
kx
ky kyverno-chainsaw: add shell completion, version test, update script 2024-07-15 12:00:39 -03:00
la lan-mouse: switch to cargoHash 2024-07-16 17:37:19 +08:00
lb lbreakouthd: 1.1.8 -> 1.1.9 2024-07-19 21:04:53 +00:00
lc
ld
le lemminx: use jdk headless 2024-07-18 09:49:44 +07:00
lg/lgogdownloader
li Merge master into staging-next 2024-07-21 06:01:25 +00:00
lk/lk-jwt-service
ll llama-cpp: 3328 -> 3403 2024-07-16 17:19:53 -03:00
lm
ln/lngen
lo localsend: 1.14.0 -> 1.15.0 2024-07-16 20:49:09 +08:00
lp
ls
lt/ltris
lu
lv/lv_font_conv
lw/lwgrp
lx Merge pull request #326620 from bbigras/incus 2024-07-15 14:47:18 -04:00
lz
m1/m1ddc
m2
ma Merge branch 'staging' into staging-next 2024-07-20 16:12:24 +02:00
mb
mc mcdreforged: 2.13.0 -> 2.13.1 2024-07-18 23:59:11 +00:00
md Merge pull request #324432 from jalil-salame/update-mdbook 2024-07-16 23:49:17 +05:30
me Merge staging-next into staging 2024-07-19 18:01:40 +00:00
mf
mg
mi
mk
ml/mlx42
mo Merge staging-next into staging 2024-07-19 00:03:05 +00:00
mp
mq mqtt-explorer: init at 0.4.0-beta.6 2024-07-18 09:34:49 +02:00
ms
mu nixos/tests/music-assistant: init 2024-07-17 22:29:38 +02:00
my Merge staging-next into staging 2024-07-19 00:03:05 +00:00
n2/n2
n8/n8n
na
nb
nc ncdc: 1.24 -> 1.24.1 2024-07-19 11:45:11 +00:00
nd/ndstrim
ne Merge branch 'staging' into staging-next 2024-07-20 16:12:24 +02:00
nf
ng
nh nh: 3.5.18 -> 3.5.19 2024-07-19 22:28:19 +00:00
ni Merge master into staging-next 2024-07-21 06:01:25 +00:00
nl
nm/nmap-parse
nn
no
np
nr
ns
nt ntpd-rs: disable testsuite, too flaky 2024-07-20 04:07:56 +02:00
nu Merge pull request #324767 from Sigmanificient/remove-unused-stdenv-arguments 2024-07-14 19:42:52 +08:00
nv
nw
nx/nxengine-evo
oa
ob Merge pull request #327090 from SFrijters/obconf-cleanup 2024-07-15 15:38:43 +08:00
oc
od odoo: add missing geoip2 dependency 2024-07-16 21:55:13 +02:00
oe/oelint-adv
of
oh
oi oidc-agent: init at 5.1.0 2024-07-16 20:03:20 +08:00
ok/okolors
ol ollama: 0.2.5 -> 0.2.7 2024-07-18 22:36:45 -03:00
om
on
oo
op Merge branch 'staging' into staging-next 2024-07-20 16:12:24 +02:00
or
os
ot
ou
ov
ow
pa Merge #319160: pahole: 1.26 -> 1.27 2024-07-20 10:10:08 +02:00
pc pcsx2-bin: added passthru.updateScript 2024-07-14 22:32:06 +01:00
pd
pe Merge pull request #328077 from reckenrode/cctools-darwin-aliases 2024-07-18 08:54:54 -04:00
pf/pfft
pg
ph Merge pull request #326324 from x123/x123-phraze-auto-update 2024-07-19 23:33:39 +03:00
pi Merge pull request #323643 from ByteSudoer/init-pinokio 2024-07-18 22:32:09 +02:00
pk
pl Merge pull request #323397 from detroyejr/plex-desktop 2024-07-17 18:47:28 +02:00
pm
pn
po poptracker: Add XDG Desktop entry 2024-07-17 12:39:09 -04:00
pp/ppsspp
pq
pr Merge pull request #328077 from reckenrode/cctools-darwin-aliases 2024-07-18 08:54:54 -04:00
ps
pt
pu
pv/pvsneslib
pw
px/pxder
py pysqlrecon: 0.1.4 -> 0.2.0 2024-07-15 11:23:02 +00:00
pz/pzip
qa/qadwaitadecorations
qb/qbittorrent-enhanced
qc/qcm
qd
qg/qgrep
qn/qnial qnial: 6.3 -> 6.3_1 2024-07-15 14:49:03 -03:00
qo/qodem
qp/qpoases
qr
qs
qt/qtractor
qu Merge pull request #327867 from mjoerg/quickemu-4.9.6 2024-07-20 02:34:32 +02:00
qw/qwerty-fr
r0/r0vm
r1/r10k
ra Merge master into staging-next 2024-07-20 18:01:23 +00:00
rc rclip: 1.10.1 -> 1.10.2 2024-07-17 19:35:58 +00:00
rd/rdwatool
re regal: 0.23.1 -> 0.24.0 2024-07-17 06:05:54 +00:00
rh/rHttp
ri tree-wide: use top-level cctools 2024-07-17 22:36:19 -04:00
rk
rl/rl_json
rm
rn/rnd-name
ro Merge pull request #325223 from mweinelt/typer-deps 2024-07-18 18:54:53 +02:00
rp/rpcs3
rq
rs Merge pull request #325798 from Guanran928/rsshub 2024-07-19 13:47:57 +02:00
rt
ru
rw/rwpspread
ry
s0/s0ix-selftest-tool
s3
sa Merge pull request #327456 from getchoo/pkgs/sarif-fmt/0.5.0 2024-07-19 16:00:27 +02:00
sb
sc Merge branch 'staging-next' into staging 2024-07-16 19:07:48 +03:00
sd
se Merge pull request #326217 from nicolas-goudry/feat/update-seabird 2024-07-18 01:43:13 +02:00
sf/sfwbar
sg/sgfutils
sh Merge pull request #327454 from getchoo/pkgs/shellcheck-sarif/0.5.0 2024-07-19 15:56:06 +02:00
si Merge pull request #326382 from aorith/silverbullet-081 2024-07-18 01:40:58 +02:00
sk Merge pull request #324602 from seanrmurphy/add-skypilot 2024-07-17 20:08:34 +02:00
sl
sm
sn snippetexpander: 1.0.2 -> 1.0.3 2024-07-16 08:40:08 +01:00
so Merge pull request #326566 from SuperSandro2000/maven-nox 2024-07-18 11:14:06 +02:00
sp Merge pull request #328018 from ereslibre/add-aarch64-spice-autorandr 2024-07-20 15:16:09 -04:00
sq
sr srm-cuarzo: 0.6.1-1 -> 0.6.3-1 2024-07-19 23:49:22 +00:00
ss
st Merge pull request #328533 from r-ryantm/auto-update/strictdoc 2024-07-20 14:05:54 -04:00
su
sv
sw Merge staging-next into staging 2024-07-18 18:01:57 +00:00
sx
sy syshud: 0-unstable-2024-07-08 -> 0-unstable-2024-07-16 2024-07-18 10:06:53 +00:00
t-/t-rex
ta tailwindcss-language-server: 0.0.20 -> 0.0.21 2024-07-19 08:04:31 +00:00
tb/tbump
tc/tcsh
td tdnf: 3.5.7 -> 3.5.8 2024-07-17 06:29:16 +00:00
te Merge staging-next into staging 2024-07-19 00:03:05 +00:00
tg
th
ti Merge pull request #326566 from SuperSandro2000/maven-nox 2024-07-18 11:14:06 +02:00
tk
tl
tm
to
tp
tr tree-wide: enable LTO on Darwin 2024-07-20 03:19:54 -04:00
ts/tsm-client
tt
tu Merge branch 'staging-next' into staging 2024-07-16 19:07:48 +03:00
tw Merge branch 'staging-next' into staging 2024-07-16 19:07:48 +03:00
tx/txr
ty typstyle: 0.11.29 -> 0.11.30 2024-07-17 07:48:47 +02:00
ub
uc
ud
ue
ug
uh/uhttpmock_1_0
ui
um/umpire
un Merge pull request #328578 from Tochiaha/unhideGui 2024-07-20 18:43:32 -03:00
up
us
ut
uu/uuu
uv/uv python312Packages.uv: 0.2.22 -> 0.2.26 2024-07-17 23:13:30 +02:00
uw/uwhoisd
ux
va
vc vcpkg: add h7x4 as maintainer 2024-07-17 09:26:14 +02:00
vd/vdhcoapp
ve vencord: 1.9.4 -> 1.9.5 2024-07-18 10:48:25 +02:00
vg/vgm2x
vi Merge pull request #328240 from balacij/master 2024-07-20 15:59:16 +02:00
vk/vkd3d
vl
vm vmagent: dont update via nixpkgs-update 2024-07-18 07:58:04 +02:00
vn vnote: 3.18.0 -> 3.18.1 2024-07-14 23:57:59 +02:00
vo
vp
vs/vscode-js-debug
vu vunnel: fix build 2024-07-18 02:45:54 -07:00
vv/vvvvvv treewide: sha256 -> hash attribute for fetchgit 2024-07-14 19:10:08 +08:00
vz/vzic
wa Merge staging-next into staging 2024-07-18 18:01:57 +00:00
wb Merge pull request #326827 from Aleksanaa/trivial-sha256-fix 2024-07-14 22:40:25 +08:00
wc/wcurl wcurl: init at 2024.07.10 2024-07-16 07:45:23 +00:00
we
wf/wf-touch
wg/wg-access-server
wh whistle: 2.9.77 -> 2.9.78 2024-07-18 18:04:02 +00:00
wi wit-bindgen: 0.27.0 -> 0.28.0 2024-07-17 06:39:51 +00:00
wl
wo Merge pull request #327356 from r-ryantm/auto-update/worker 2024-07-16 22:33:22 +00:00
wp
wr/wrangler
ws wstunnel: 9.7.2 -> 9.7.4 2024-07-20 16:02:15 +00:00
wt
wx/wxc
wy/wyoming-satellite
x1/x16
x5/x509-limbo
xa/xarcan
xc
xd
xe xemu: 0.7.127 -> 0.7.128 2024-07-15 14:38:21 +00:00
xf/xfs-undelete
xh/xhosts
xi
xl xlights: 2024.12 -> 2024.13 2024-07-14 16:37:27 +00:00
xm treewide: sha256 -> hash attribute for fetchgit 2024-07-14 19:10:08 +08:00
xn/xnlinkfinder
xo
xp
xr/xr-hardware
xs
xu/xunit-viewer
xw Merge pull request #326800 from sodiboo/niri 2024-07-19 16:40:18 +02:00
ya Merge pull request #328406 from herbetom/yanic-add-version-var 2024-07-20 16:07:49 +02:00
yc/ycmd
yd/ydotool
ye
yg/yggdrasil
yj/yj
yo
ys/ysfx
yt
yu
za zapret: init as 0-unstable-2024-07-16 (#327675) 2024-07-16 23:08:33 +00:00
zb/zbus-xmlgen
zc/zcfan
ze
zf/zfind
zi
zl/zluda
zm/zmkBATx
zo
zp
zs
zu/zug
zw/zwave-js-server
zx
README.md

Name-based package directories

The structure of this directory maps almost directly to top-level package attributes. Add new top-level packages to Nixpkgs using this mechanism whenever possible.

Packages found in the name-based structure are automatically included, without needing to be added to all-packages.nix. However if the implicit attribute defaults need to be changed for a package, this must still be declared in all-packages.nix.

Example

The top-level package pkgs.some-package may be declared by setting up this file structure:

pkgs
└── by-name
   ├── so
   ┊  ├── some-package
      ┊  └── package.nix

Where some-package is the package name and so is the lowercased 2-letter prefix of the package name.

The package.nix may look like this:

# A function taking an attribute set as an argument
{
  # Get access to top-level attributes for use as dependencies
  lib,
  stdenv,
  libbar,

  # Make this derivation configurable using `.override { enableBar = true }`
  enableBar ? false,
}:

# The return value must be a derivation
stdenv.mkDerivation {
  # ...
  buildInputs =
    lib.optional enableBar libbar;
}

You can also split up the package definition into more files in the same directory if necessary.

Once defined, the package can be built from the Nixpkgs root directory using:

nix-build -A some-package

See the general package conventions for more information on package definitions.

Changing implicit attribute defaults

The above expression is called using these arguments by default:

{
  lib = pkgs.lib;
  stdenv = pkgs.stdenv;
  libbar = pkgs.libbar;
}

But the package might need pkgs.libbar_2 instead. While the function could be changed to take libbar_2 directly as an argument, this would change the .override interface, breaking code like .override { libbar = ...; }. So instead it is preferable to use the same generic parameter name libbar and override its value in pkgs/top-level/all-packages.nix:

{
  libfoo = callPackage ../by-name/so/some-package/package.nix {
    libbar = libbar_2;
  };
}

Manual migration guidelines

Most packages are still defined in all-packages.nix and the category hierarchy. Please hold off migrating your maintained packages to this directory.

  1. An automated migration for the majority of packages is being worked on. In order to save on contributor and reviewer time, packages should only be migrated manually afterwards if they couldn't be migrated automatically.

  2. Manual migrations should only be lightly encouraged if the relevant code is being worked on anyways. For example with a package update or refactoring.

  3. Manual migrations should not remove definitions from all-packages.nix with custom arguments. That is a backwards-incompatible change because it changes the .override interface. Such packages may still be moved to pkgs/by-name however, while keeping the definition in all-packages.nix. See also changing implicit attribute defaults.

Limitations

There's some limitations as to which packages can be defined using this structure:

  • Only packages defined using pkgs.callPackage. This excludes packages defined using pkgs.python3Packages.callPackage ....

    Instead:

    • Either change the package definition to work with pkgs.callPackage.
    • Or use the category hierarchy.
  • Only top-level packages. This excludes packages for other package sets like pkgs.pythonPackages.*.

    Refer to the definition and documentation of the respective package set to figure out how such packages can be declared.

Validation

CI performs certain checks on the pkgs/by-name structure. This is done using the nixpkgs-check-by-name tool.

You can locally emulate the CI check using

$ ./maintainers/scripts/check-by-name.sh master

See here for more info.

Recommendation for new packages with multiple versions

These checks of the pkgs/by-name structure can cause problems in combination:

  1. New top-level packages using callPackage must be defined via pkgs/by-name.
  2. Packages in pkgs/by-name cannot refer to files outside their own directory.

This means that outside pkgs/by-name, multiple already-present top-level packages can refer to some common file. If you open a PR to another instance of such a package, CI will fail check 1, but if you try to move the package to pkgs/by-name, it will fail check 2.

This is often the case for packages with multiple versions, such as

{
  foo_1 = callPackage ../tools/foo/1.nix { };
  foo_2 = callPackage ../tools/foo/2.nix { };
}

The best way to resolve this is to not use callPackage directly, such that check 1 doesn't trigger. This can be done by using inherit on a local package set:

{
  inherit
    ({
      foo_1 = callPackage ../tools/foo/1.nix { };
      foo_2 = callPackage ../tools/foo/2.nix { };
    })
    foo_1
    foo_2
    ;
}

While this may seem pointless, this can in fact help with future package set refactorings, because it establishes a clear connection between related attributes.

Further possible refactorings

This is not required, but the above solution also allows refactoring the definitions into a separate file:

{
  inherit (import ../tools/foo pkgs)
    foo_1 foo_2;
}
# pkgs/tools/foo/default.nix
pkgs: {
  foo_1 = callPackage ./1.nix { };
  foo_2 = callPackage ./2.nix { };
}

Alternatively using callPackages if callPackage isn't used underneath and you want the same .override arguments for all attributes:

{
  inherit (callPackages ../tools/foo { })
    foo_1 foo_2;
}
# pkgs/tools/foo/default.nix
{
  stdenv
}: {
  foo_1 = stdenv.mkDerivation { /* ... */ };
  foo_2 = stdenv.mkDerivation { /* ... */ };
}

Exposing the package set

This is not required, but the above solution also allows exposing the package set as an attribute:

{
  foo-versions = import ../tools/foo pkgs;
  # Or using callPackages
  # foo-versions = callPackages ../tools/foo { };

  inherit (foo-versions) foo_1 foo_2;
}