nixpkgs/pkgs/by-name
2024-11-23 17:50:42 +01:00
..
_0
_1 1fps: add darwin support (#351731) 2024-11-01 18:04:58 +01:00
_2/_2ship2harkinian
_4
_6/_64gram {kotatogram-desktop,_64gram,materialgram}: fix overriding withWebkit 2024-11-03 20:37:07 -05:00
_9
a4/a4
a5/a52dec
aa
ab abracadabra: move to by-name 2024-11-02 21:13:21 +01:00
ac aces-container: fix darwin build 2024-11-04 16:40:49 -06:00
ad
ae aerogramme: mark as broken 2024-11-02 18:08:55 +08:00
af
ag aggregate6: init at 1.0.12 2024-11-03 17:41:19 +01:00
ai Update aider (#353083) 2024-11-03 06:32:06 -05:00
al alsa-plugins: add more dependencies, make existing dependencies unconditional 2024-11-03 16:33:38 +03:00
am amazon-ssm-agent: 3.3.859.0 -> 3.3.987.0 (#349994) 2024-11-01 18:17:29 +01:00
an ansel: 0-unstable-2024-08-13 -> 0-unstable-2024-09-29 (#345346) 2024-11-02 16:49:03 +01:00
ao/aocl-utils
ap
aq/aquamarine
ar ark-pixel-font: fix build for ZHF (#353495) 2024-11-04 19:39:04 +01:00
as asleap: move to by-name 2024-11-04 19:33:27 -06:00
at atlauncher: 3.4.37.3 -> 3.4.37.4 2024-11-02 21:35:48 +04:00
au
av
aw
ax
ay
az
b3/b3sum
ba bacon: 3.0.0 -> 3.2.0 (#353733) 2024-11-05 11:23:31 +01:00
bc
bd
be berry: fix darwin build 2024-11-05 13:50:13 -06:00
bi
bk/bk
bl
bm
bn/bngblaster
bo boxbuddy: 2.2.13 -> 2.3.1 2024-11-01 21:54:46 +00:00
bp
bq/bqn
br brave: fix qt theming (#352667) 2024-11-04 20:25:21 +01:00
bs
bt
bu
by
c2
c3/c3-lsp
c-
ca caido: 0.42.0 -> 0.43.1 (#353203) 2024-11-04 10:20:52 +08:00
cb cbconvert: init at 1.0.4 2024-11-04 07:24:14 -06:00
cc cctools: set Darwin team as maintainers 2024-11-04 23:01:25 +00:00
cd
ce
cf
cg
ch chirpstack-gateway-bridge: init at 4.0.11 2024-11-23 17:50:42 +01:00
ci
cj/cjs
cl clairvoyant: 3.1.7 -> 3.1.8 (#352683) 2024-11-05 21:58:40 +01:00
cm
cn
co coroot: 1.5.9 -> 1.5.11 (#352460) 2024-11-05 22:08:49 +01:00
cp mpiCheckPhaseHook: disable openmpi's ssh plugin (#351473) 2024-11-02 13:33:57 +01:00
cq/cq
cr
cs csvtk: install shell completions 2024-11-01 23:28:36 +04:00
ct
cu
cv/cvemap
cw/cwe-client-cli
cy
cz/czkawka
da
db dbip-{country,asn,city}-lite: 2024-10 -> 2024-11 (#352898) 2024-11-02 08:42:52 -04:00
dc
dd
de detect-it-easy: 3.09 -> 3.10 (#353539) 2024-11-05 06:35:46 +11:00
dg dgen-sdl: fix darwin build 2024-11-04 05:02:23 +01:00
dh/dhcpig
di dialect: 2.4.2 -> 2.5.0 (#353294) 2024-11-05 05:42:41 +01:00
dj/djent
dm
dn dnsdiag: 2.5.0 -> 2.6.0 2024-11-04 09:26:36 +01:00
do dotbot: fix build (#351656) 2024-11-04 10:06:05 +08:00
dp
dq/dq
dr
ds
dt
du
dv
dw
dx
dy
e1/e1s
ea earlyoom: remove AndersonTorres from maintainers (#353091) 2024-11-02 21:28:01 +01:00
eb
ec ecapture: 0.8.8 -> 0.8.9 2024-11-03 20:37:00 +08:00
ed edge-runtime: 1.53.4 -> 1.60.1 2024-11-04 16:16:50 +08:00
ee/eepers
ef
eg/eg25-manager eg25-manager: 0.5.0 -> 0.5.2 2024-11-02 23:09:34 +01:00
ei
ej ejabberd: 24.07 -> 24.10; add updateScript (#352790) 2024-11-04 05:19:56 -05:00
ek
el
em ember-cli: remove mkYarnPackage usage (#342153) 2024-11-03 11:05:53 +01:00
en ente-auth: fix icon path 2024-11-01 16:21:55 +01:00
eo/eog
ep
eq
er
es
et
eu
ev GNOME updates 2024-11-02 (#353154) 2024-11-05 20:39:01 +08:00
ew
ex exodus: 24.19.4 -> 24.41.3 2024-11-01 18:53:49 +01:00
ey/eyewitness
ez/eza
f2/f2fs-tools
fa fastfetch: 2.28.0 -> 2.29.0 2024-11-04 17:29:08 +01:00
fb/fbset
fc
fd/fdroidserver
fe
ff
fg/fgqcanvas
fi fish-lsp: init at 1.0.8-1 (#330996) 2024-11-05 08:18:47 +01:00
fj/fjo
fl florist: init at 24.2 (#350193) 2024-11-05 12:07:23 +08:00
fm
fn fna3d: init at 24.11 (#266200) 2024-11-03 09:56:18 +01:00
fo forgejo-runner: 3.5.1 -> 4.0.1 2024-11-01 18:08:49 +01:00
fp fprintd-tod: fix build 2024-11-03 14:47:13 +08:00
fr fritz-exporter: add attrs to relaxed deps 2024-11-04 19:11:23 +01:00
fs
ft
fu
fv
fw/fwupd
fx/fx
fy
fz
g3/g3kb-switch
g-/g-wrap
ga garble: add passthru.updateScript; 0.8.0 -> 0.13.0; add bot-wxt1221 as maintainers 2024-11-03 17:27:15 +08:00
gb
gc
gd openvpn3: v20 -> v23 (#326623) 2024-11-01 21:27:18 +01:00
ge gepetto-viewer: 5.1.0 -> 5.2.0, gepetto-viewer-corba: 5.8.0 -> 5.8.1 (#347765) 2024-11-03 03:00:52 +01:00
gf
gg/gg
gh gh-contribs: init at 0.9.0 (#352927) 2024-11-05 21:08:25 +01:00
gi git-fast-export: 221024 -> 231118 (#353612) 2024-11-05 12:11:42 +08:00
gk/gk-cli
gl glom: fix build (#346684) 2024-11-02 00:38:52 +08:00
gm gmt: fix build (#343919) 2024-11-03 17:24:18 +01:00
gn GNOME updates 2024-11-02 (#353154) 2024-11-05 20:39:01 +08:00
go gortr: Adopting package and refactor (#351612) 2024-11-05 17:01:41 +01:00
gp
gr graphicsmagick: 1.3.43 -> 1.3.45 (#348480) 2024-11-02 18:01:32 +01:00
gs
gt
gu guile-sdl: mark broken on darwin 2024-11-05 15:17:58 +01:00
gv/gvisor
gw/gweled
gx
gz/gzdoom
h2/h2
h5/h5utils
h8/h8mail
ha
hb/hb-honeypot
hc/hclfmt
hd
he
hi
hj/hjson-go
hn/hn-text
ho
hp
hr/hred
ht httplib: 0.18.0 -> 0.18.1 (#351140) 2024-11-01 18:07:43 +01:00
hu hugo: 0.136.4 -> 0.136.5 2024-11-01 19:57:16 +00:00
hv/hvm
hw/hwinfo
hx/hxtools
hy hyprgui: 0.1.6 -> 0.1.7 (#353308) 2024-11-04 02:33:29 +05:30
i2/i2p
i3
ia
ic
id
if
ig
ii
ij
im immich: comment reasoning for jellyfin-ffmpeg 2024-11-03 14:43:49 +01:00
in
io
ip
ir
is
it
iu/iucode-tool
iv iverilog: Update homepage link 2024-11-04 11:40:04 +01:00
iw
iz/izrss
j/j
ja
jc/jcli
jd/jdt-language-server
je jetbrains-toolbox: 2.4.1.32573 -> 2.5.1.34629 2024-11-05 08:17:20 +00:00
ji
jj/jj
jn
jo
jp/jp-zip-codes
jq
jr
js
jt
ju
jw/jwasm
k8
ka kapacitor: 1.7.0 -> 1.7.5 (#344895) 2024-11-04 19:32:59 +01:00
kb/kbld
kc
kd
ke keycastr: 0.9.18 -> 0.10.1 (#352919) 2024-11-03 03:42:28 +01:00
kg/kgeotag
ki
kl
km
kn
ko komikku: 1.58.0 -> 1.60.0 2024-11-03 19:21:57 +01:00
kp/kplex
kr
ks
kt
ku
kv/kvmarwaita
kw/kwok
kx
ky kyverno-chainsaw: 0.2.8 -> 0.2.11 2024-11-05 10:45:49 -06:00
la lazysql: fix incorrect version output (#353654) 2024-11-05 12:28:16 +01:00
lb
lc
ld ld64: set Darwin team as maintainers 2024-11-04 23:01:29 +00:00
le Revert "less: Fix withSecure regression" 2024-11-04 12:00:21 +01:00
lg/lgogdownloader
li lime3ds: 2118.2 -> 2119 (#352487) 2024-11-05 22:07:51 +01:00
lk/lk-jwt-service
ll
lm
ln/lngen
lo local-ai: 2.21.1 -> 2.22.1 2024-11-01 23:14:08 +01:00
lp
lr/lrcget
ls lsd: switch to apple-sdk_11 2024-11-05 10:46:53 +10:00
lt/ltris
lu lunar-client: 3.2.24 -> 3.2.26 2024-11-03 17:57:01 +01:00
lv/lv_font_conv
lw
lx
lz
m1/m1ddc
m2
ma maid: update dependencies to fix security vulnerability (#352628) 2024-11-05 02:24:53 +01:00
mb
mc
md
me melodeon: 0.4.1 -> 0.4.2 2024-11-03 00:19:12 +00:00
mf
mg
mi mimir: 2.14.0 -> 2.14.1 (#353644) 2024-11-05 05:45:31 -05:00
mj/mjmap
mk
ml/mlx42
mm
mo moonlight-qt: refactor darwin support (#352615) 2024-11-05 22:05:18 +01:00
mp mpc: 0.34 -> 0.35 2024-11-01 20:07:03 -03:00
mq
mr/mricron
ms
mt
mu mujoco: 3.2.4 -> 3.2.5 2024-11-05 12:53:22 +01:00
mv/mvt mvt: init at 2.5.4 2024-11-01 19:39:37 +00:00
my
n2/n2
n8/n8n
n9/n98-magerun2
na
nb
nc
nd
ne netease-cloud-music-gtk: format with nixfmt-rfc-style 2024-11-03 16:04:09 +08:00
nf
ng
nh
ni nix-search: init at 0.4.0 2024-11-03 17:52:29 +08:00
nl
nm
nn
no notes: 2.3.0 -> 2.3.1 2024-11-01 18:29:56 +00:00
np
nr
ns
nt
nu nuclei-templates: 10.0.2 -> 10.0.3 2024-11-03 06:42:55 +00:00
nv
nw
nx/nxengine-evo
ny/nym
nz nzbhydra2: 7.7.0 -> 7.8.0 2024-11-01 22:32:09 +00:00
oa
ob
oc
od
oe/oelint-adv
of
og/oguri
oh
oi
ok
ol
om
on
oo
op opentelemetry-collector-builder: 0.101.0 -> 0.112.0 2024-11-02 13:50:45 +00:00
oq/oqs-provider
or GNOME updates 2024-11-02 (#353154) 2024-11-05 20:39:01 +08:00
os
ot oterm: 0.4.2 -> 0.6.1 2024-11-03 22:14:45 +01:00
ou
ov
ow
p3/p3x-onenote
pa parallel-disk-usage: 0.9.3 -> 0.10.0 (#353273) 2024-11-03 16:41:08 +00:00
pb/pb
pc
pd
pe peertube-viewer: clean up package a bit (#342146) 2024-11-02 13:37:06 +01:00
pf
pg
ph
pi pizauth: fix build on darwin 2024-11-05 03:30:33 +08:00
pk
pl plandex-server: add git to path 2024-11-04 13:07:53 -04:00
pm
pn
po postmoogle: 0.9.21 -> 0.9.24 (#351931) 2024-11-05 22:33:08 +01:00
pp/ppsspp ppsspp: 1.17.1 -> 1.18 2024-11-03 15:24:32 +00:00
pq
pr proxmox-auto-install-assistant: init at 8.2.6 (#348351) 2024-11-01 23:54:58 +01:00
ps
pt
pu
pv
pw pwru: 1.0.8 -> 1.0.9 2024-11-01 11:33:49 -04:00
px/pxder
py pylyzer: 0.0.68 -> 0.0.69 2024-11-04 10:58:22 +01:00
pz/pzip
q2/q2pro
qa/qadwaitadecorations
qb/qbittorrent-enhanced
qc/qcm
qd
qe/qemu_xen
qg
qm
qn/qnial
qo/qodem
qp/qpoases
qq/qq
qr
qs
qt
qu quick-lookup: 2.1.1 -> 2.1.2 2024-11-04 03:37:57 +00:00
qw/qwerty-fr
r0/r0vm
r1/r10k
ra raycast: 1.84.10 -> 1.84.12 2024-11-05 13:03:08 +00:00
rc
rd/rdwatool
re redmine: 5.1.3 -> 5.1.4 (#353555) 2024-11-04 16:47:35 -05:00
rf/rfdump
rh
ri rime-japanese: init at 0-unstable-2023-08-02 (#295849) 2024-11-05 12:27:34 +01:00
rk
rl/rl_json
rm rmg-wayland: 0.6.5 -> 0.6.6 (#346279) 2024-11-02 19:10:52 +01:00
rn
ro
rp
rq
rr/rrdtool
rs rs-tftpd: 0.3.1 -> 0.3.2 2024-11-02 17:07:28 -04:00
rt
ru rush-parallel: 0.5.6 -> 0.5.7 (#352916) 2024-11-02 10:29:54 +00:00
rw/rwpspread
rx/rxvt
ry
s0/s0ix-selftest-tool
s3
s7/s7 s7: init at 11.2-unstable-2024-11-02 2024-11-02 20:52:51 +08:00
sa
sb
sc schemamap: 0.4.0 -> 0.4.3 (#349511) 2024-11-05 16:54:49 +08:00
sd SDL_gpu: Fix build on clang 16 2024-11-04 20:01:29 +08:00
se
sf
sg/sgfutils
sh shadps4: 0.3.0-unstable-2024-10-14 -> 0.4.0 (#352770) 2024-11-04 14:33:05 +01:00
si simple64: add desktop file (#353525) 2024-11-05 16:01:54 +01:00
sk sketchybar: switch to apple-sdk_15 (#352620) 2024-11-03 03:46:52 +00:00
sl slweb: 0.10.1 -> 0.10.2 2024-11-02 23:59:15 +01:00
sm
sn snyk: 1.1293.1 -> 1.1294.0 (#351173) 2024-11-05 22:30:38 +01:00
so solana: 1.17.31 -> 1.18.26 2024-11-03 16:06:11 +04:00
sp
sq
sr
ss
st structorizer: 3.32-22 -> 3.32-23 (#351701) 2024-11-05 22:22:16 +01:00
su sunvox: 2.1.1c -> 2.1.2 (#349298) 2024-11-01 11:35:07 -04:00
sv
sw swayosd: 0-unstable-2024-04-15 -> 0.1.0 (#353591) 2024-11-06 00:39:51 +08:00
sx
sy
t-/t-rex
ta tabby: darwin sdk refactor; 0.18.0 -> 0.19.0 (#352908) 2024-11-03 22:58:58 +01:00
tb/tbump
tc/tcsh
td tdl: 0.17.5 -> 0.17.7 2024-11-03 22:22:04 +00:00
te templ: 0.2.778 -> 0.2.793 (#352427) 2024-11-02 13:44:03 +00:00
tf/tflint
tg
th
ti
tk
tl
tm
to toot: 0.42.0 -> 0.45.0 2024-11-02 16:17:29 +08:00
tp tpm-fido: init at 0-unstable-2024-10-30 (#352282) 2024-11-05 11:33:15 +01:00
tr
ts
tt
tu tuisky: init at 0.1.3 (#353202) 2024-11-03 10:22:50 +01:00
tw
tx
ty typstyle: 0.12.0 -> 0.12.1 2024-11-03 10:08:37 +01:00
u-
ub
uc
ud
ue uesave: init at 0.5.0 2024-11-01 21:52:45 -07:00
ug
uh/uhttpmock_1_0
ui
um/umpire
un Cleanup helsinki maintainer (#353611) 2024-11-04 12:59:26 +01:00
up
ur
us usql: 0.19.3 -> 0.19.12 2024-11-03 18:32:32 +01:00
ut
uu/uuu
uv/uv
uw
ux
va valent: 1.0.0.alpha.46 -> 1.0.0.alpha.46-unstable-2024-10-26 2024-11-01 23:15:19 +08:00
vc
vd/vdhcoapp
ve veryl: 0.13.1 -> 0.13.2 (#352567) 2024-11-05 12:45:56 +01:00
vf/vfkit
vg
vi video-trimmer: 0.8.2 -> 0.9.0 (#353303) 2024-11-04 09:11:57 +02:00
vk
vl
vm
vn
vo
vp
vr/vrcadvert
vs
vt/vt323
vu vunnel: relax more deps 2024-11-02 00:02:45 +01:00
vv/vvvvvv
vw/vwsfriend
vy
vz/vzic
wa Remove mcaju as maintainer (#353426) 2024-11-04 09:15:21 -08:00
wb
wc
we weblate: fix build (#353487) 2024-11-05 08:03:52 +01:00
wf/wf-touch
wg
wh
wi
wl
wo
wp
wr
ws
wt
wu/wush
wv
wx/wxc
wy/wyoming-satellite
x1/x16
x4/x4
xa
xc
xd xdg-desktop-portal-cosmic: inline pname 2024-11-03 23:15:27 +01:00
xe
xf/xfs-undelete
xh/xhosts
xi
xl
xm
xn/xnlinkfinder
xo python312Packages.xonsh: 0.18.3 -> 0.18.4 2024-11-03 04:05:05 +00:00
xp
xr
xs
xt/xtf
xu/xunit-viewer
xv/xviewer
xw
ya yalc: migrate from nodePackages 2024-11-05 02:45:57 -05:00
yc/ycmd
yd/ydotool
ye
yg
yj/yj
yo yourkit-java: 2024.3-b161 -> 2024.9-b158 (#346763) 2024-11-02 16:42:52 +01:00
yp/ypbind-mt
ys/ysfx
yt yt-dlp: 2024.10.22 -> 2024.11.4 (#353623) 2024-11-05 01:19:15 +01:00
yu
za zapret: 0-unstable-2024-08-01 -> 67 (#348160) 2024-11-01 21:27:36 +00:00
zb/zbus-xmlgen
zc
ze zed-editor: 0.159.7 -> 0.159.10 2024-11-04 10:13:47 -05:00
zf
zi
zl/zluda
zm/zmkBATx
zo zoekt: 3.7.2-2-unstable-2024-10-01 -> 3.7.2-2-unstable-2024-10-24 (#351386) 2024-11-02 17:09:55 +01:00
zp
zs
zu
zv/zvbi
zw/zwave-js-server
zx
zy/zydis
zz/zziplib
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 attribute name corresponding to the package, and so is the lowercase 2-letter prefix of the attribute 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. Since it would take a lot of contributor and reviewer time to migrate all packages manually, an automated migration is planned, though it is expected to still take some time to get done. If you're interested in helping out with this effort, please see this ticket.

Since only PRs to packages in pkgs/by-name can be automatically merged, if package maintainers would like to use this feature, they are welcome to migrate their packages to pkgs/by-name. To lessen PR traffic, they're encouraged to also perform some more general maintenance on the package in the same PR, though this is not required and must not be expected.

Note that callPackage definitions in all-packages.nix with custom arguments should not be removed. That is a backwards-incompatible change because it changes the .override interface. Such packages may still be moved to pkgs/by-name however, in order to avoid the slightly superficial choice of directory / category in which the default.nix file was placed, but please keep the definition in all-packages.nix using callPackage. See also changing implicit attribute defaults.

Definitions like the following however, can be transitioned:

# all-packages.nix
fooWithBaz = foo.override {
  bar = baz;
};
# turned into pkgs/by-name/fo/fooWithBaz/package.nix with:
{
  foo,
  baz,
}:

foo.override {
  bar = baz;
}

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-vet tool.

You can locally emulate the CI check using

$ ./ci/nixpkgs-vet.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;
}