2
0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-02-20 02:55:39 +00:00
nixpkgs/pkgs/by-name
2024-06-03 12:45:29 +00:00
..
_0/_0xpropo
_4
_6/_64gram _64gram: 1.1.23 -> 1.1.24 2024-06-01 06:38:32 +00:00
_9/_9base
a4/a4
a5/a52dec
aa
ab
ac
ad ad-miner: 1.2.0 -> 1.3.0 2024-05-31 16:32:28 +00:00
ae aegisub: fix build on darwin 2024-05-31 16:14:45 +02:00
af
ag
ai
al
am
an ananicy-rules-cachyos: 0-unstable-2024-05-10 -> 0-unstable-2024-05-28 2024-05-31 09:06:20 +00:00
ao/aocl-utils
ap api-linter: 1.66.0 -> 1.66.1 2024-05-27 09:20:13 +00:00
ar arc-browser: 1.44.2-50412 -> 1.44.3-50502 2024-06-02 01:16:18 +03:00
as ast-grep: 0.22.3 -> 0.22.4 2024-05-27 13:20:07 +00:00
at
au Merge pull request from isabelroses/auto-cpufreq 2024-05-31 19:11:01 -07:00
av
aw
ax
ay ayatana-indicator-power: 24.5.0 -> 24.5.1 2024-06-03 12:45:29 +00:00
ba Merge pull request from kiike/pkgs/basedpyright 2024-05-25 07:49:34 +09:00
bc bcachefs-tools: replace -> replace-fail 2024-05-26 10:43:01 +02:00
bd/bdf2ttf
be Merge pull request from wegank/beekeeper-studio-hash 2024-05-30 10:09:22 +02:00
bi Merge pull request from khaneliman/mainprogram 2024-05-31 22:50:10 +02:00
bk/bk
bl blockbench: 4.10.1 -> 4.10.2 2024-05-30 01:25:03 +00:00
bm/bmake
bn/bngblaster
bo Merge pull request from Mrmaxmeier/bombsquad-fix-update-script 2024-05-28 18:29:21 +02:00
bp
bq/bqn bqn: migrate to by-name 2024-05-26 10:56:52 -03:00
br
bs
bt
bu
by
c2 c2patool: 0.9.1 -> 0.9.2 2024-05-29 03:12:17 +00:00
c-
ca Merge pull request from JohnRTitor/catppuccin-plymouth 2024-06-02 13:47:13 +03:00
cb
cc ccache: make src reproducible 2024-06-02 08:13:54 -07:00
cd
ce centrifugo: 5.3.2 -> 5.4.0 2024-06-01 16:00:20 +00:00
cg
ch chezmoi: 2.48.1 -> 2.48.2 2024-05-31 15:50:12 +00:00
ci
cl clickup: init at 3.3.79 2024-06-02 00:04:33 +03:00
cm
cn/cntb
co codeium: 1.8.42 -> 1.8.51 2024-05-31 19:35:57 +00:00
cp cppitertools: init at 2.1 2024-05-24 22:14:14 -06:00
cr crossplane: fix passthru.tests.version 2024-06-01 22:24:53 +02:00
cs
ct/ctx
cu
cv/cvemap
cy
cz/czkawka
da
db Merge pull request from luftmensch-luftmensch/dbgate_5.2.7 2024-06-02 19:28:52 +02:00
dc/dc3dd
dd
de
dg/dgoss dgoss: sync with goss 2024-05-29 10:26:55 +02:00
dh/dhcpig
di
dj/djent
dm
dn/dns2tcp
do Merge pull request from r-ryantm/auto-update/dorion 2024-06-02 18:21:33 +02:00
dp
dr
ds
dt
du duckstation: 0.1-6292 -> 0.1-6658 2024-05-28 10:40:27 -03:00
dv/dvb-apps
dx treewide: remove unused occurence of fetchFromGitHub argument 2024-05-30 05:56:07 +00:00
dy dynamodb-local: 2.4.0 -> 2.5.0 2024-05-29 12:58:39 +00:00
e1/e1s e1s: 1.0.34 -> 1.0.36 2024-05-28 05:12:51 +00:00
ea
eb
ec
ed
ee/eepers
ei
ek/eksctl eksctl: 0.178.0 -> 0.179.0 2024-05-29 09:51:22 +00:00
el Merge pull request from kilimnik/element-call 2024-05-26 21:37:25 +02:00
em
en
ep/epub-thumbnailer
er errands: 46.2 -> 46.2.2 2024-05-26 12:01:46 +02:00
es espflash: 3.0.0 -> 3.1.0 2024-05-27 12:07:23 +02:00
et eta: init at 1.0.1 2024-06-02 15:33:18 +03:00
eu
ev Merge pull request from jn-sena/everforest-gtk-init 2024-06-02 23:39:53 +02:00
ew/eww
ex
ez/eza
fa fastfetch: 2.13.2 -> 2.14.0 2024-05-31 07:01:36 +00:00
fb/fbset
fc Merge pull request from Guanran928/fcitx5-themes 2024-06-03 00:02:07 +02:00
fe felix-fm: 2.12.1 -> 2.13.0 2024-05-25 16:09:04 +02:00
ff fflogs: 8.5.6 -> 8.5.9 2024-05-28 01:39:38 +00:00
fg/fgqcanvas
fi Merge pull request from Sigmanificient/filterpath 2024-05-30 13:45:12 +02:00
fl treewide: remove unused occurence of fetchFromGitHub argument 2024-05-30 05:56:07 +00:00
fm
fn/fnott
fo Merge pull request from Yarny0/foomatic-db-update 2024-06-02 17:58:13 +02:00
fr francis: 1.1.0 -> 24.05.0 2024-05-25 03:50:50 +00:00
fs
ft/fte
fu
fv
fw/fwupd
fy/fypp
fz
g3/g3kb-switch g3kb-switch: 1.4 -> 1.5 2024-05-27 09:10:34 +08:00
ga gate: 0.36.7 -> 0.37.0 2024-05-31 15:54:49 +00:00
gb
gc
ge
gf
gg/gg
gh Merge pull request from isabelroses/fix/gh-eco 2024-05-27 21:16:19 +02:00
gi
gl
gm gimpPlugins.gmic: 3.3.5 -> 3.3.6 2024-05-31 18:25:50 +00:00
gn gnome-monitor-config: init at 0-unstable-2023-09-26 2024-05-27 15:09:21 +02:00
go google-chrome: 125.0.6422.112 -> 125.0.6422.141 2024-06-02 08:35:55 +02:00
gp gpt4all: 2.7.5 -> 2.8.0 2024-05-25 13:42:30 +02:00
gr grafana-kiosk: 1.0.6 -> 1.0.7 2024-05-31 14:24:56 +00:00
gt
gu gungnir: 1.0.8 -> 1.0.9 2024-05-30 14:30:22 +00:00
gv/gvisor
gx/gxml
h8/h8mail
ha Merge pull request from onemoresuza/hare-fix-mime-module 2024-06-02 23:49:01 +02:00
hb/hb-honeypot
hd
he hermitcli: 0.39.1 -> 0.39.2 2024-05-31 01:32:32 +00:00
hi Merge pull request from YMSTNT/update-hifile 2024-05-27 10:47:16 -04:00
hj/hjson-go
ho home-manager: 0-unstable-2024-05-23 -> 0-unstable-2024-05-30 2024-05-30 21:37:20 +00:00
ht
hu Merge pull request from teto/teto/hurl-add-completion 2024-06-01 12:28:33 +08:00
hy hyprshot: 1.2.3 -> 1.3.0 2024-06-02 00:03:54 +02:00
i2/i2p i2p: 2.5.1 -> 2.5.2 2024-05-30 08:53:23 +00:00
i3
ia
ic icloudpd: 1.17.6 -> 1.18.0 2024-05-28 05:30:25 +00:00
id
if/ifrextractor-rs
ig Merge pull request from r-ryantm/auto-update/igir 2024-06-02 16:13:40 +02:00
ii
im Merge pull request from SomeoneSerge/feat/imgui-cmake 2024-05-29 12:48:33 +00:00
in Merge pull request from r-ryantm/auto-update/incus 2024-06-01 23:21:51 -04:00
io/ioq3-scion
ip
ir
is/iscc
it
iw/iw
iz/izrss
ja Merge pull request from r-ryantm/auto-update/jan 2024-05-27 20:08:18 +02:00
jd/jdt-language-server
je
ji
jj/jj
jn jnv: 0.2.3 -> 0.3.0 2024-06-02 13:11:42 +00:00
jo
jq/jq-zsh-plugin jq-zsh-plugin: init at 0.6.1 () 2024-05-28 11:57:03 +00:00
jr/jrl-cmakemodules
js/jsoncons
jt/jtdx
ju justbuild: 1.2.4 -> 1.3.1 2024-05-31 20:23:10 +02:00
ka Merge pull request from r-ryantm/auto-update/karmor 2024-05-28 02:14:35 +00:00
kc
kd
ke keepass: 2.56 -> 2.57 2024-06-02 02:35:36 +00:00
kg/kgeotag
ki
kl/klog-time-tracker
km
kn/knossosnet
ko Merge : init koboldcpp at 1.66 2024-05-28 12:08:11 +00:00
kp/kplex
kr
ks
kt
ku kube-state-metrics: init at 2.12.0 () 2024-05-28 14:46:22 +02:00
kx
ky kyverno-chainsaw: 0.2.2 -> 0.2.3 2024-05-29 13:17:45 +00:00
la labwc-menu-generator: 0-unstable-2024-03-27 -> 0-unstable-2024-05-27 2024-05-29 22:12:56 +00:00
lb
lc
ld/ldproxy
le lefthook: 1.6.13 -> 1.6.14 2024-06-01 21:43:57 +00:00
li libmediainfo: 24.04 -> 24.05 2024-06-02 04:16:22 +00:00
lk/lk-jwt-service
ll Merge pull request from r-ryantm/auto-update/llama-cpp 2024-06-02 10:25:13 +09:00
lm lmstudio: 0.2.22 -> 0.2.24 2024-05-28 15:06:01 -03:00
ln/lngen
lo logiops: 0.3.3 -> 0.3.4 2024-05-28 04:09:23 +00:00
lp
ls
lt/ltris
lu Merge pull request from eliandoran/dev/lunacy-fix-toast 2024-05-31 22:35:56 +08:00
lw/lwgrp
lx lxgw-neoxihei: 1.121 -> 1.123 2024-05-24 17:48:37 +00:00
lz
m2
ma Merge pull request from r-ryantm/auto-update/makima 2024-06-02 19:05:18 +02:00
mb
mc
md
me Merge pull request from rhelmot/freebsd-minimal3/meson2 2024-05-31 15:27:15 -04:00
mf
mg
mi Merge pull request from r-ryantm/auto-update/misconfig-mapper 2024-05-27 15:41:15 +02:00
mk
ml/mlx42
mo
mp
mq
ms
mu
my mystmd: 1.2.0 -> 1.2.5 2024-06-01 19:11:33 +00:00
n2/n2
na namespace-cli: 0.0.372 -> 0.0.373 2024-05-29 04:52:16 +00:00
nb/nbtscan
nc
nd/ndstrim
ne Merge pull request from Aleksanaa/netease-cloud-music-gtk 2024-06-01 18:38:28 +08:00
nf
ng ngrrram: init at 1.0.3 2024-05-29 07:17:01 +08:00
nh nh: 3.5.15 -> 3.5.16 2024-06-03 04:55:13 +00:00
ni nim_lk: 20240510 -> 20240527 2024-05-29 21:10:09 +00:00
nl
nm/nmap-parse
nn/nncp
no node-hp-scan-to: 1.4.2 -> 1.4.3 2024-05-27 04:22:32 +02:00
np
nr nrr: 0.9.1 -> 0.9.2 2024-05-31 02:03:45 +00:00
ns
nt/ntfs2btrfs
nu Numbat: 1.11 -> 1.12 2024-05-31 09:33:31 +02:00
nv
nw nwg-hello: 0.1.10 -> 0.2.0 2024-06-01 06:35:29 +00:00
nx/nxengine-evo
oa
ob
oc
oe/oelint-adv oelint-adv: 5.3.2 -> 5.4.0 2024-05-29 12:15:01 +00:00
of
oh oh-my-posh: 20.2.0 -> 21.0.1 2024-05-31 11:20:49 +00:00
oi oil: 0.21.0 -> 0.22.0 2024-06-02 02:42:51 +00:00
ol ollama: 0.1.38 -> 0.1.39 2024-05-29 16:06:55 -04:00
om omnictl: 0.35.1 -> 0.36.0 2024-05-24 15:51:28 +00:00
on
oo/oo7 oo7: init at 0.3.2 2024-05-30 10:07:03 +02:00
op openfga: 1.5.3 -> 1.5.4 2024-05-31 01:31:39 +00:00
or
os
ot
ou
ov
ow
pa Merge pull request from r-ryantm/auto-update/passt 2024-06-02 16:31:34 +02:00
pd pdpmake: 1.4.1 -> 1.4.2 2024-05-25 03:57:03 +00:00
pe peergos: 0.17.0 -> 0.18.0 2024-05-27 18:53:26 +00:00
pf/pfft
pg
ph phpdocumentor: 3.4.3 -> 3.5.0 2024-05-24 15:31:09 +00:00
pi pinact: 0.1.3 -> 0.2.0 2024-05-25 13:38:44 +00:00
pk
pl Merge pull request from JohnRTitor/plymouth-vortex-ubuntu-theme 2024-06-01 19:48:57 +02:00
pm pmtiles: 1.19.1 -> 1.19.2 2024-05-29 04:15:18 +00:00
pn
po Merge pull request from r-ryantm/auto-update/powerpipe 2024-05-30 21:10:12 +02:00
pp/ppsspp
pq
pr Merge pull request from srhb/squid-exporter 2024-06-02 19:28:45 +02:00
ps/ps_mem
pt
pu puppet-bolt: do not reset default gem config 2024-05-31 16:46:26 +03:00
pv/pvsneslib
pw Merge pull request from amyipdev/pwalarmd-v2 2024-05-31 22:55:37 +08:00
px/pxder
py Merge pull request from afh/remove-dontCheck 2024-06-02 17:10:56 +02:00
pz/pzip
qa/qadwaitadecorations
qc/qcm qcm: 1.0.2 -> 1.0.3 2024-05-29 05:30:12 +00:00
qd/qdirstat
qg/qgrep
qp/qpoases
qr
qs
qt/qtractor
qu
r0/r0vm
r1/r10k
ra rasm: 2.2.3 -> 2.2.4 2024-05-30 13:17:37 +00:00
rc
rd/rdwatool
re Merge pull request from r-ryantm/auto-update/renode-unstable 2024-06-02 15:14:48 +02:00
rh/rHttp
ri Merge pull request from r-ryantm/auto-update/ripunzip 2024-06-02 01:27:06 +02:00
rk
rl/rl_json
rm
rn/rnd-name
ro
rp/rpcs3
rq
rs
rt
ru
rw/rwpspread
ry
s0/s0ix-selftest-tool
s3
sa Merge pull request from r-ryantm/auto-update/satty 2024-05-31 13:27:18 -04:00
sb/sbom-utility
sc
sd
se Merge pull request from arikgrahl/setup-envtest 2024-06-02 23:37:48 +02:00
sg/sgfutils sgfutils: fix build on darwin 2024-05-29 07:15:36 +02:00
sh shopware-cli: 0.4.43 -> 0.4.44 2024-05-27 15:50:37 +00:00
si Merge pull request from r-ryantm/auto-update/simplex-chat-desktop 2024-06-02 16:40:53 +02:00
sk sketchybar-app-font: 2.0.18 -> 2.0.19 2024-05-27 04:23:50 +00:00
sl slumber: 1.3.1 -> 1.3.2 2024-05-27 15:22:22 +02:00
sm smile: 2.9.0 → 2.9.5 () 2024-05-28 11:43:08 +00:00
sn Merge pull request from luftmensch-luftmensch/snipaste_2.9-Beta2 2024-06-02 19:10:55 +02:00
so Merge pull request from tricktron/f-sonarlint-ls 2024-05-25 17:35:15 +02:00
sp Merge pull request from aaronjheng/spirit 2024-05-25 09:13:36 -04:00
sq squeezelite: format 2024-05-24 15:49:11 -04:00
sr srm-cuarzo: 0.5.6-1 -> 0.5.6-2 2024-05-31 14:43:11 -04:00
ss
st stalwart-mail: package upstream systemd unit 2024-05-31 10:22:15 +02:00
su supergfxctl-plasmoid: init at 2.0.0 () 2024-06-02 19:01:35 +02:00
sv
sw switch-to-configuration-ng: retain escaped content in unit files 2024-05-29 10:24:42 -07:00
sx
sy systemctl-tui: 0.3.5 -> 0.3.6 2024-05-30 06:43:05 +00:00
t-/t-rex
ta
tc/tcsh
td tdf: init at 0-unstable-2024-05-29 2024-06-02 15:48:27 +02:00
te Merge pull request from r-ryantm/auto-update/telescope 2024-06-02 19:07:06 +02:00
tg/tgpt
th
ti tinymist: 0.11.9 -> 0.11.10 2024-05-26 09:34:23 +02:00
tk
tl
tm/tmuxifier
to
tp
tr Merge pull request from r-ryantm/auto-update/trunk-ng 2024-06-01 17:17:27 +02:00
tt
tu
tw
tx/txr
ty typstyle: 0.11.23 -> 0.11.24 2024-05-27 20:25:45 +02:00
uc
ud
ue
ug
uh/uhttpmock_1_0
ui
um/umpire
un unciv: 4.11.13 -> 4.11.16 2024-06-01 08:29:19 +00:00
up updatecli: 0.77.0 -> 0.78.0 2024-05-30 17:53:10 +00:00
us
ut
uu/uuu
uv/uv python311Packages.uv: 0.2.4 -> 0.2.5 2024-05-31 03:25:01 +00:00
uw/uwhoisd
ux uxn: 1.0-unstable-2024-05-10 -> 1.0-unstable-2024-05-30 2024-05-31 20:06:11 +00:00
va
vc vcpkg: 2024.04.26 -> 2024.05.24 2024-05-29 05:46:55 +00:00
vd/vdhcoapp
ve
vg/vgm2x
vi Merge : init vim-startuptime at 1.3.2 2024-05-28 11:56:12 +00:00
vl
vm/vms-empire vms-empire: 1.16 -> 1.17 2024-05-25 22:10:31 -03:00
vo/voidmap
vu vunnel: 0.23.0 -> 0.23.2 2024-05-24 23:20:39 +02:00
vv/vvvvvv
wa wakatime: rename to wakatime-cli 2024-06-02 17:12:06 +02:00
wb
we Merge pull request from eclairevoyant/webcord-vencord-fix 2024-05-26 15:57:10 +08:00
wh
wi Merge pull request from DontEatOreo/pkgs-win-disk-writer 2024-06-02 19:57:32 +02:00
wl Merge pull request from r-ryantm/auto-update/wlr-layout-ui 2024-05-31 23:16:33 +08:00
wo
wp
ws
wt
wy/wyoming-satellite
x1/x16
x5/x509-limbo
xa/xarcan
xc
xd
xe
xf/xfs-undelete
xh/xhosts
xi
xl/xlights
xm
xn/xnlinkfinder
xo
xp
xr/xr-hardware
xs
xw/xwayland-run
ya yara-x: 0.3.0 -> 0.4.0 2024-05-29 14:11:37 +02:00
yc/ycmd
yd/ydotool
ye
yg/yggdrasil yggdrasil: 0.5.5 -> 0.5.6 2024-05-31 03:11:33 +00:00
yj/yj
yo Merge pull request from hogcycle/yoink 2024-06-03 00:02:49 +00:00
ys/ysfx
yt
yu
za
zb/zbus-xmlgen
zc/zcfan
ze zed-editor: 0.137.5 -> 0.137.6 2024-05-31 23:27:28 +02:00
zi zig-shell-completions: nixfmt 2024-05-27 20:35:27 -03:00
zl/zluda
zo zoraxy: init at 3.0.5 2024-05-27 17:40:41 +02:00
zp
zs zsh-wd: init at 0.7.0 2024-05-26 15:59:48 -07:00
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;
}