nixpkgs/pkgs/by-name
2024-09-10 11:58:18 -04:00
..
_0/_0xpropo
_1/_1fps _1fps: init at 0.1.10 2024-09-08 21:08:20 +02:00
_2/_2ship2harkinian
_4
_6/_64gram
_9/_9base
a4/a4
a5/a52dec
aa
ab abcmidi: 2024.08.11 -> 2024.08.13 2024-09-07 22:28:35 -06:00
ac
ad
ae
af
ag make age-plugin-fido2-hmac work on darwin (#339299) 2024-09-05 22:06:12 +01:00
ai
al albert: move to by-name 2024-09-08 18:00:36 +01:00
am amazon-ssm-agent: 3.3.808.0 -> 3.3.859.0 2024-09-09 10:55:53 +00:00
an ansel: 0-unstable-2024-07-09 -> 0-unstable-2024-08-13 2024-09-08 09:32:26 +00:00
ao/aocl-utils
ap apt-offline: substitute --replace with --replace-fail (#337269) 2024-09-05 10:59:23 -04:00
aq/aquamarine aquamarine: 0.4.0 -> 0.4.1 2024-09-08 07:32:41 +00:00
ar
as asfa: 0.10.0 -> 0.10.0-1 (#337378) 2024-09-09 22:01:57 +02:00
at athens: 0.14.1 -> 0.15.1 (#340700) 2024-09-09 10:52:18 +02:00
au authentik: 2024.6.1 -> 2024.6.4 (#340543) 2024-09-08 22:23:26 +01:00
av
aw
ax
ay tests/ayatana-indicators: Add ayatana-indicators-bluetooth 2024-09-06 11:59:46 +02:00
az
b3/b3sum
ba backgroundremover: substitute --replace with --replace-fail (#337276) 2024-09-05 10:59:55 -04:00
bc
bd
be bevelbar: 24.06 -> 24.07 (#337670) 2024-09-10 00:55:16 +02:00
bi bitwarden-cli: 2024.8.1 -> 2024.8.2 2024-09-05 15:10:37 -04:00
bk/bk
bl dotnetCorePackages.fetchNupkg: override avalonia.x11 to find native libs 2024-09-06 16:32:08 -03:00
bm
bn/bngblaster
bo boogie: 3.2.3 -> 3.2.4 (#335316) 2024-09-09 22:52:39 +02:00
bp
bq/bqn
br brainflow: 5.12.1 -> 5.13.2 (#338265) 2024-09-08 00:20:15 +02:00
bs
bt
bu
by
c-
c2
ca cameractrls: 0.6.6 -> 0.6.7 (#340933) 2024-09-10 16:37:48 +08:00
cb
cc
cd
ce
cf/cf-tool
cg
ch chawan: 0-unstable-2024-08-03 -> 0-unstable-2024-09-03 (#336480) 2024-09-09 22:18:06 +02:00
ci cirrus-cli: 0.124.2 -> 0.125.1 2024-09-08 19:14:12 +00:00
cj/cjs
cl clash-verge-rev: add meta for internal package (#340771) 2024-09-10 16:14:41 +08:00
cm
cn
co code-cursor: init at 0.40.4 (#337331) 2024-09-10 16:31:37 +08:00
cp
cq/cq
cr {cronutils,formatjson5,igvm-tooling,uplosi}: add passthru.update-script (#338136) 2024-09-09 09:11:28 +02:00
cs
ct/ctx
cu cuetsy: init at 0.1.11 (#340223) 2024-09-07 22:33:58 +08:00
cv/cvemap
cw/cwe-client-cli
cy
cz/czkawka
da
db dbeaver-bin: add webkitgkt and glib-networking for webbrowser support (#336742) 2024-09-05 19:10:29 +02:00
dc
dd
de deltachat-desktop: 1.46.7 -> 1.46.8 (#340847) 2024-09-09 13:58:36 -07:00
dg/dgoss
dh/dhcpig
di discover-overlay: 0.7.4 -> 0.7.8 (#335033) 2024-09-09 23:57:38 +02:00
dj/djent
dm
dn
do dotenvx: 1.8.0 -> 1.14.0 (#337739) 2024-09-10 10:35:00 +09:00
dp
dr
ds
dt
du dumbpipe: 0.13.0 -> 0.16.0 2024-09-09 13:23:37 +00:00
dv/dvb-apps
dw
dx
dy dynisland: init at 0.1.3 2024-09-07 16:28:36 -06:00
e1/e1s
ea eask: Rename eask -> eask-cli 2024-09-06 02:16:03 -07:00
eb
ec
ed
ee/eepers
ef/efibootmgr
eg/eg25-manager
ei eintopf: 0.13.16 -> 0.14.1 (#336806) 2024-09-06 00:48:07 +00:00
ej/ejsonkms
ek ekho: use finalAttrs 2024-09-09 09:04:33 +00:00
el
em
en envision-unwrapped: 0-unstable-2024-07-03 -> 0-unstable-2024-09-06 2024-09-07 16:47:12 +02:00
eo/eog
ep
er
es eslint: 9.9.1 -> 9.10.0 2024-09-08 12:42:49 -05:00
et
eu
ev
ew/eww
ex exificient: init at 1.0.7 2024-09-06 13:53:24 +01:00
ey/eyewitness
ez/eza
f2/f2fs-tools
fa fast-float: 6.1.5 -> 6.1.6 2024-09-09 01:43:33 +02:00
fb/fbset
fc
fe
ff fflogs: 8.13.1 -> 8.13.5 2024-09-09 05:48:48 +00:00
fg/fgqcanvas
fi fireplace: init at 0-unstable-2020-02-02 (#340389) 2024-09-10 13:28:21 +00:00
fj/fjo
fl flashprog: add funkeleinhorn as maintainer 2024-09-07 14:33:33 +02:00
fm
fn/fnott
fo {cronutils,formatjson5,igvm-tooling,uplosi}: add passthru.update-script (#338136) 2024-09-09 09:11:28 +02:00
fr friture: 0.49-unstable-2024-06-02 -> 0.51 2024-09-09 01:16:40 +08:00
fs
ft/fte
fu
fv
fw/fwupd
fx/fx
fy
fz
g3/g3kb-switch
ga gatus: 5.12.0 -> 5.12.1 2024-09-09 11:44:23 +00:00
gb
gc
gd
ge gearlever: 2.0.6 -> 2.0.7 2024-09-09 20:01:01 +08:00
gf
gg/gg
gh gh-markdown-preview: 1.7.0 -> 1.8.0 2024-09-10 12:59:47 +00:00
gi gitlab-ci-ls: init at 0.21.1 (#340083) 2024-09-08 18:00:11 +02:00
gk/gk-cli
gl
gm
gn gnome-flashback: Fix mkSystemdTargetForWm eval 2024-09-07 16:40:36 +08:00
go goat: unstable-2022-08-15 -> 0-unstable-2024-07-31 (#338137) 2024-09-09 09:11:10 +02:00
gp gpu-burn: unstable-2023-11-10 -> unstable-2024-04-09; update CUDA packaging 2024-09-05 21:36:41 +00:00
gr graphite-cli: 1.4.3 -> 1.4.4 2024-09-06 09:49:47 +00:00
gt
gu
gv/gvisor
gx/gxml
h2/h2
h5/h5utils
h8/h8mail
ha hadolint-sarif: 0.6.5 -> 0.6.6 (#340004) 2024-09-07 09:53:43 -04:00
hb/hb-honeypot
hc/hclfmt
hd
he heptabase: 1.35.5 -> 1.37.0 2024-09-08 11:00:09 +00:00
hi
hj/hjson-go
hn/hn-text
ho home-manager: 0-unstable-2024-08-23 -> 0-unstable-2024-09-09 2024-09-09 20:03:44 +00:00
hp
ht
hu
hv/hvm
hw/hwinfo
hx/hxtools
hy hydra: improve structuredAttrs support (#340840) 2024-09-10 00:06:09 +03:00
i2/i2p
i3
ia
ic
id
if
ig igir: 2.9.2 -> 2.11.0 (#329391) 2024-09-09 23:11:12 +02:00
ii
ij
im
in Merge master into staging-next 2024-09-09 12:05:58 +00:00
io iotools: Format package.nix 2024-09-07 02:42:49 +02:00
ip
ir
is
it
iu/iucode-tool iucode-tool: Move package file into by-name structure 2024-09-07 22:56:04 +02:00
iv
iw/iw
iz/izrss
ja
jc/jcli
jd/jdt-language-server
je
ji
jj/jj
jn
jo
jq/jq-zsh-plugin
jr
js
jt/jtdx
ju Merge master into staging-next 2024-09-05 18:03:49 +00:00
jw/jwasm
k8/k8s-manifest-sigstore
ka kazv: init at 0.5.0 (#334844) 2024-09-06 16:05:45 +08:00
kc
kd
ke keypunch: 1.0 -> 3.1 2024-09-09 20:39:58 +08:00
kg/kgeotag
ki kitex: 0.10.3 -> 0.11.0 2024-09-09 17:25:58 +00:00
kl
km
kn dotnetCorePackages.fetchNupkg: override avalonia.x11 to find native libs 2024-09-06 16:32:08 -03:00
ko kokkos: 4.3.01 -> 4.4.00 (#335928) 2024-09-09 22:39:45 +02:00
kp/kplex
kr
ks
kt
ku
kv/kvmarwaita
kx
ky
la lazygit: 0.43.1 -> 0.44.0 2024-09-07 11:54:02 +03:00
lb
lc
ld
le lefthook: 1.7.14 -> 1.7.15 2024-09-09 19:26:26 +00:00
lg/lgogdownloader
li libdeltachat: 1.142.11 -> 1.142.12 2024-09-09 11:57:38 -07:00
lk/lk-jwt-service
ll llama-cpp: 3645 -> 3672 2024-09-06 04:58:14 +00:00
lm
ln/lngen
lo
lp
lr/lrcget
ls
lt/ltris
lu lutgen: 0.10.1 -> 0.11.0 (#340142) 2024-09-07 21:54:51 -04:00
lv/lv_font_conv
lw/lwgrp
lx lxgw-wenkai-screen: init at version 1.330 2024-09-06 19:45:36 -04:00
lz
m1/m1ddc
m2
ma marwaita-mint: 20.3.1 -> 21 2024-09-10 08:19:25 +00:00
mb
mc
md
me melonDS: 0.9.5-unstable-2024-08-21 -> 0.9.5-unstable-2024-09-06 (#340730) 2024-09-10 12:12:13 +00:00
mf
mg
mi misconfig-mapper: 1.8.3 -> 1.8.4 (#340411) 2024-09-08 09:56:30 +02:00
mk
ml/mlx42
mo Merge staging-next 2024-09-01 (#338840) 2024-09-10 07:42:45 +02:00
mp mpris-notifier: 0.1.7 -> 0.1.9 2024-09-10 01:17:16 +00:00
mq
mr/mricron
ms
mu museum: photos-v0.9.30 -> photos-v0.9.35 (#340195) 2024-09-08 18:23:31 -04:00
my
n2/n2
n8/n8n n8n: 1.55.3 -> 1.57.0 2024-09-09 19:54:01 +00:00
n9/n98-magerun2
na
nb
nc
nd/ndstrim
ne dotnetCorePackages.fetchNupkg: override avalonia.x11 to find native libs 2024-09-06 16:32:08 -03:00
nf
ng
nh nhost-cli: 1.23.0 -> 1.24.0 2024-09-08 06:07:27 +00:00
ni nitrokey-fido2-firmware: init at 2.4.1 (#337951) 2024-09-10 16:21:18 +02:00
nl
nm
nn nncp: 8.10.0 -> 8.11.0 2024-09-09 18:13:56 +00:00
no notation: 1.1.1 -> 1.2.0 (#338121) 2024-09-07 19:58:44 +02:00
np
nr
ns
nt
nu
nv
nw nwg-clipman: init at 0.2.3 (#326392) 2024-09-09 12:23:41 +08:00
nx/nxengine-evo
nz
oa
ob
oc
od
oe/oelint-adv oelint-adv: 5.7.2 -> 6.0.0 2024-09-08 11:00:14 +00:00
of offat: relax setuptools 2024-09-06 10:28:21 +02:00
oh
oi
ok okteto: 2.30.2 -> 2.31.0 2024-09-06 01:28:27 +00:00
ol
om omekasy: 1.2.3 -> 1.3.1 2024-09-09 14:37:23 +00:00
on
oo
op Merge master into staging-next 2024-09-09 00:14:38 +00:00
oq/oqs-provider
or orchard: 0.22.1 -> 0.23.0 2024-09-06 01:27:44 +00:00
os oscavmgr: init at 0.4.1 (#339627) 2024-09-09 19:17:00 +02:00
ot
ou
ov
ow
pa
pc
pd
pe
pf/pfft
pg
ph photini: fix by using pyside6 (#332006) 2024-09-09 18:42:09 +02:00
pi picom-pijulius: 8.2-unstable-2024-08-30 -> 8.2-unstable-2024-09-08 2024-09-08 16:38:22 +00:00
pk
pl
pm pmtiles: add geospatial team as maintainer 2024-09-06 08:41:37 +02:00
pn
po poethepoet: 0.27.0 -> 0.28.0 2024-09-07 11:04:00 +00:00
pp/ppsspp
pq
pr protoc-gen-es: fix missing node_modules directories (#339841) 2024-09-09 14:17:55 +00:00
ps
pt
pu pupdate: 3.12.0 -> 3.13.0 2024-09-06 20:35:40 +00:00
pv
pw
px/pxder
py
pz/pzip
qa/qadwaitadecorations
qb/qbittorrent-enhanced
qc/qcm
qd
qg/qgrep
qm/qmplay2
qn/qnial
qo/qodem
qp/qpoases
qq/qq qq: 3.2.12-2024.8.19 -> 3.2.12-2024.9.2 2024-09-06 06:24:14 +00:00
qr Revert "qrtool: switch to GitLab source" 2024-09-06 16:59:10 -07:00
qs
qt qtalarm: init at 2.5.1 (#337732) 2024-09-10 22:12:09 +08:00
qu quarkus: 3.14.1 -> 3.14.2 2024-09-09 01:20:17 +00:00
qw/qwerty-fr
r0/r0vm
r1/r10k
ra radicle-node: 1.0.0-rc.17 → 1.0.0 2024-09-10 13:54:51 +02:00
rc rcu: disable build on hydra 2024-09-05 21:36:28 +03:00
rd/rdwatool
re renovate: 38.62.0 -> 38.73.5 2024-09-10 05:45:03 +00:00
rf/rfdump
rh/rHttp
ri
rk
rl/rl_json
rm
rn
ro roave-backward-compatibility-check: 8.8.0 -> 8.9.0 2024-09-08 13:12:06 +00:00
rp/rpcs3
rq
rr/rrdtool
rs
rt
ru rustlings: add darwin support by adding CoreServices to buildInputs (#339263) 2024-09-09 13:30:07 +00:00
rw/rwpspread
ry dotnetCorePackages.fetchNupkg: override avalonia.x11 to find native libs 2024-09-06 16:32:08 -03:00
s0/s0ix-selftest-tool
s3 s3scanner: 3.0.4 -> 3.1.0 2024-09-09 02:33:43 +00:00
sa sarif-fmt: 0.6.5 -> 0.6.6 2024-09-06 07:04:30 +00:00
sb sby: 0.44 -> 0.45 (#340966) 2024-09-10 12:13:16 +00:00
sc Merge master into staging-next 2024-09-09 14:31:17 +00:00
sd
se serpl: 0.1.34 -> 0.3.3 2024-09-08 22:41:37 +08:00
sf
sg/sgfutils
sh shpool: 0.6.3 -> 0.7.0 (#339300) 2024-09-09 23:15:57 +08:00
si simplex-chat-desktop: 6.0.3 -> 6.0.4 (#340069) 2024-09-06 14:07:58 +01:00
sk
sl
sm
sn snipe-it: 7.0.7 -> 7.0.11 (#330025) 2024-09-09 23:26:08 +02:00
so so: fix build 2024-09-08 11:23:35 -04:00
sp sploitscan: 0.10.5 -> 0.11.0 2024-09-09 22:25:35 +00:00
sq
sr srm-cuarzo: 0.7.1-1 -> 0.7.2-1 2024-09-08 02:30:34 +00:00
ss
st steampipe: 0.23.5 -> 0.24.0 (#339993) 2024-09-08 18:38:20 +00:00
su subtitleedit: 4.0.7 -> 4.0.8 2024-09-07 12:17:54 +03:00
sv
sw switch-to-configuration-ng: clear environment when reexecing as user 2024-09-06 19:52:56 +03:00
sx
sy
t-/t-rex
ta
tb/tbump
tc
td tdl: 0.17.3 -> 0.17.4 2024-09-09 03:06:25 +00:00
te terragrunt: 0.66.9 -> 0.67.3 (#338735) 2024-09-09 19:38:58 +02:00
tg
th thrift-ls: change binary name to mimic upstream 2024-09-10 21:32:32 +10:00
ti Merge master into staging-next 2024-09-06 18:03:54 +00:00
tk
tl
tm
to todesk: init at 4.7.2.0 (#310474) 2024-09-10 21:42:59 +08:00
tp tparse: add ldflags 2024-09-07 02:16:16 +04:00
tr trunk-io: 1.3.1 -> 1.3.2 (#340457) 2024-09-09 09:11:18 -04:00
ts
tt
tu
tw
tx
ty
u-/u-config
ub
uc Clean up cross bootstrapping, take 2 (#321525) 2024-09-06 14:56:54 -04:00
ud
ue
ug
uh/uhttpmock_1_0
ui
um/umpire
un unl0kr: remove tomfitzhenry@ as maintainer (#333616) 2024-09-06 12:50:55 +08:00
up {cronutils,formatjson5,igvm-tooling,uplosi}: add passthru.update-script (#338136) 2024-09-09 09:11:28 +02:00
ur/urban-cli
us
ut
uu/uuu
uv/uv uv: 0.4.7 -> 0.4.8 2024-09-10 10:41:16 +00:00
uw
ux
va
vc
vd/vdhcoapp
ve vencord: 1.9.5 -> 1.10.1 (#332423) 2024-09-07 20:20:59 +00:00
vf/vfkit
vg
vi
vk
vl
vm
vn
vo
vp vpsfree-client: 0.18.0 -> 0.19.0 (#339850) 2024-09-05 23:57:13 +02:00
vr/vrcadvert vrcadvert: init at 1.0.0 2024-09-05 17:49:32 +02:00
vs vscode-js-debug: 1.91.0 -> 1.93.0 (#332398) 2024-09-09 23:49:58 +02:00
vu Merge master into staging-next 2024-09-06 12:05:08 +00:00
vv/vvvvvv
vw/vwsfriend
vz/vzic
wa Merge master into staging-next 2024-09-08 06:04:18 +00:00
wb
wc/wcurl
we
wf/wf-touch
wg/wg-access-server
wh when-cli: init at 0.4.0 2024-09-10 08:53:13 +00:00
wi wizer: 7.0.4 -> 7.0.5 2024-09-06 03:21:52 +00:00
wl
wo
wp
wr/wrangler
ws
wt
wu/wush
wv
wx/wxc
wy/wyoming-satellite
x1/x16
x5/x509-limbo
xa
xc
xd
xe
xf/xfs-undelete
xh/xhosts
xi
xl
xm
xn/xnlinkfinder
xo
xp
xr
xs
xt/xtf xtf: 0-unstable-2024-07-25 -> 0-unstable-2024-08-30 2024-09-09 13:27:21 +00:00
xu/xunit-viewer
xv/xviewer
xw
ya yandex-music: 5.14.0 -> 5.15.0 (#340968) 2024-09-10 10:45:09 +00:00
yc/ycmd
yd/ydotool
ye
yg
yj/yj
yo yourkit-java: 2024.3-b157 -> 2024.3-b161 2024-09-06 06:50:12 +00:00
yp/ypbind-mt
ys/ysfx
yt
yu
za
zb/zbus-xmlgen
zc
ze zed-editor: 0.151.1 -> 0.151.2 2024-09-06 12:32:32 -04:00
zf/zfind
zi
zl/zluda
zm/zmkBATx
zo
zp
zs
zu
zw/zwave-js-server
zx
README.md pkgs/by-name: Update manual migration guidelines 2024-09-07 03:59:47 +02:00

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. 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 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, 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-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;
}