nixpkgs/pkgs/by-name
2024-09-04 19:54:30 -04:00
..
_0/_0xpropo
_2/_2ship2harkinian
_4
_6/_64gram
_9/_9base
a4/a4
a5/a52dec
aa
ab treewide: remove refs/tags/ from github release meta.changelog urls 2024-08-29 22:45:00 -04:00
ac act: migrate to by-name 2024-09-01 18:06:56 +04:00
ad ada: 2.9.1 -> 2.9.2 2024-09-03 10:11:16 -04:00
ae aerc: import a patch fix a bug with gpg signed messages (#337401) 2024-09-04 13:16:47 +08:00
af
ag gnome-bluetooth{,_1_0}: Move to by-name 2024-09-01 14:16:31 +02:00
ai aider-chat: 0.53.0 -> 0.54.0 2024-09-03 12:59:34 +00:00
al
am amazon-ssm-agent: substitute --replace with --replace-fail (#337268) 2024-09-02 20:32:37 -04:00
an ansel: fix build 2024-09-01 19:13:57 +02:00
ao/aocl-utils
ap apfsprogs: substitute --replace with --replace-fail (#337271) 2024-09-02 20:33:31 -04:00
aq/aquamarine aquamarine: 0.3.3 -> 0.4.0 2024-09-02 21:47:43 +05:30
ar artalk: fix ui hash 2024-09-04 13:53:43 +08:00
as astartectl: 23.5.1 -> 23.5.2 2024-09-03 00:40:39 +00:00
at
au audiobookshelf: 2.12.3 -> 2.13.2 2024-09-02 12:23:32 +00:00
av
aw awscli2: 2.17.18 -> 2.17.42 2024-09-01 17:05:46 +02:00
ax
ay gnome-settings-daemon{,43}: Move from gnome scope to top-level 2024-09-01 14:16:31 +02:00
az azure-cli-extensions.containerapp: 0.3.53 -> 1.0.0b1 2024-09-03 08:15:39 +02:00
b3/b3sum
ba treewide: remove refs/tags/ from github release meta.changelog urls (#338301) 2024-09-01 10:53:48 +09:00
bc python3Packages.bcc: init at 0.31.0 2024-09-04 17:30:57 +08:00
bd
be beon: init at 2024-02-26 (#337890) 2024-09-03 11:13:40 +02:00
bi bitrise: 2.20.0 -> 2.20.1 2024-08-31 20:56:29 +00:00
bk/bk
bl blade-formatter: switch to yarnHooks 2024-09-04 11:15:47 -03:00
bm bmaptool: rename from bmap-tools and bump 3.6 -> 3.8.0 (#332434) 2024-09-02 11:35:06 +02:00
bn/bngblaster
bo boxbuddy: 2.2.9 -> 2.2.10 2024-08-31 00:29:33 +00:00
bp
bq/bqn
br breakpointHook: move to by-name, mark broken instead of asserting 2024-08-30 15:03:42 -07:00
bs
bt
bu mutter{,43}: Move from gnome scope to top-level 2024-09-01 14:16:31 +02:00
by
c-
c2 c2patool: 0.9.7 -> 0.9.8 2024-08-31 00:27:27 +00:00
ca catppuccin-cursors: 0.3.0 -> 0.3.1 (#336832) 2024-09-01 13:28:18 +00:00
cb
cc
cd
ce cemu: fix build, missing wayland-scanner 2024-08-31 11:14:44 +02:00
cf/cf-tool cf-tool: init at 202405140250 2024-08-31 22:54:46 +08:00
cg
ch taler-{sync,challenger}: rename from {sync,challenger} 2024-09-04 12:45:21 +02:00
ci cirrus-cli: migrate to by-name 2024-09-01 16:53:43 +04:00
cj/cjs
cl cloudflare-dynamic-dns: 4.3.0 -> 4.3.2 2024-09-04 12:28:27 +00:00
cm cmd-wrapped: 0.2.0 -> 0.4.1 2024-09-02 10:07:32 +08:00
cn
co container-structure-test: 1.18.1 -> 1.19.1 (#339312) 2024-09-04 19:54:30 -04:00
cp cpu-x: fix gtk support (#335367) 2024-09-04 11:12:17 +08:00
cq/cq
cr crystal-dock: init at 2.2 (#332121) 2024-09-03 00:50:45 +01:00
cs csharpier: 0.28.2 -> 0.29.1 (#338016) 2024-09-01 19:48:19 -06:00
ct/ctx
cu
cv/cvemap
cw/cwe-client-cli cwe-client-cli: init at 0.3.2 2024-09-01 21:21:59 +03:00
cy cyme: 1.8.1 -> 1.8.2 2024-08-30 18:29:28 +00:00
cz/czkawka
da
db dbeaver-bin: 24.1.5 -> 24.2.0 2024-09-03 06:22:01 +00:00
dc
dd
de deltachat-desktop: 1.46.5 -> 1.46.7 (#338211) 2024-09-03 08:32:27 -07:00
dg/dgoss
dh/dhcpig
di disko: 1.6.1 -> 1.7.0 2024-09-04 01:54:10 +00:00
dj/djent
dm dms: init at 1.6.0 2024-09-04 10:24:23 +02:00
dn
do docfd: 7.0.0 -> 8.0.1 (#337919) 2024-09-01 10:04:21 +02:00
dp
dr
ds
dt
du duckstation: Fix build on aarch64-linux 2024-09-04 01:46:32 +02:00
dv/dvb-apps
dw dwl: 0.6 -> 0.7 2024-08-30 14:52:04 +02:00
dx
dy
e1/e1s
ea
eb
ec
ed edk2: add loongarch64 support 2024-09-02 11:12:24 +03:00
ee/eepers
ef/efibootmgr
eg/eg25-manager
ei
ej/ejsonkms
ek/eksctl eksctl: 0.189.0 -> 0.190.0 2024-09-04 12:36:31 +00:00
el element-call: use yarnInstallHook 2024-09-04 11:15:47 -03:00
em
en
eo/eog
ep
er
es eslint: 9.7.0 -> 9.9.1 2024-08-31 10:46:21 +02:00
et
eu
ev
ew/eww
ex
ey/eyewitness
ez/eza
f2/f2fs-tools
fa fastfetch: 2.22.0 -> 2.23.0 2024-09-02 22:17:03 -05:00
fb/fbset
fc
fe feishin: 0.7.3 -> 0.8.0 2024-09-04 03:40:45 +01:00
ff fflogs: 8.12.19 -> 8.13.1 (#336212) 2024-09-01 16:52:32 +00:00
fg/fgqcanvas
fi filebot: 5.1.4 -> 5.1.5 (#336870) 2024-09-03 19:53:54 +08:00
fj/fjo
fl flake-edit: init at 0.1.0 2024-09-04 17:46:54 +02:00
fm
fn/fnott
fo
fr fragments: 3.0.0 -> 3.0.1 (#337479) 2024-09-04 22:25:22 +08:00
fs
ft/fte
fu
fv
fw/fwupd
fx/fx
fy
fz
g3/g3kb-switch
ga gate: 0.39.2 -> 0.39.3 (#335674) 2024-09-01 22:44:23 -04:00
gb
gc
gd
ge geesefs: 0.41.1 -> 0.41.2 2024-09-03 13:39:13 +00:00
gf
gg/gg gg: 0.2.18 -> 0.2.19 2024-08-31 13:04:51 +00:00
gh ghdl: enable builds on "x86_64-darwin" (#335975) 2024-09-03 19:51:19 +08:00
gi gickup: 0.10.34 -> 0.10.36 2024-09-04 13:47:49 -04:00
gk/gk-cli
gl glfw-minecraft: merge glfw-wayland-minecraft into glfw 2024-09-01 15:12:21 +02:00
gm
gn gnome-monitor-config: fix cross compilation, set strictDeps (#338668) 2024-09-03 01:57:15 +03:00
go google-chrome: disable update notification 2024-09-05 01:10:24 +05:30
gp
gr
gt
gu
gv/gvisor
gx/gxml
h2/h2
h5/h5utils
h8/h8mail
ha havoc: 0.5.0 -> 0.6.0 2024-09-04 01:59:39 +00:00
hb/hb-honeypot
hc/hclfmt
hd hdrop: 0.5.0 -> 0.6.0 2024-09-02 18:41:36 +02:00
he hextazy: 0.4 -> 0.6 (#329376) 2024-09-04 08:58:36 +02:00
hi
hj/hjson-go
hn/hn-text
ho
hp
ht
hu hugo: 0.133.1 -> 0.134.0 2024-09-04 05:09:00 +08:00
hv/hvm
hw/hwinfo hwinfo: fix cross compilation 2024-09-03 12:57:49 +02:00
hx/hxtools
hy hypridle: fix build, missing wayland-scanner 2024-08-31 11:23:44 +02:00
i2/i2p
i3
ia
ic
id
if
ig
ii
ij
im impala: 0.2.1 -> 0.2.3 2024-09-04 00:40:27 +00:00
in inshellisense: 0.0.1-rc.15 -> 0.0.1-rc.16 (#338240) 2024-09-03 10:18:41 +02:00
io
ip
ir
is
it
iv
iw/iw
iz/izrss
ja
jc/jcli
jd/jdt-language-server
je
ji
jj/jj
jn
jo josm: 19160 → 19207 2024-09-03 17:31:45 +02:00
jq/jq-zsh-plugin
jr jreleaser-cli: 1.13.1 -> 1.14.0 2024-08-31 13:14:13 +00:00
js
jt/jtdx
ju just: 1.34.0 -> 1.35.0 2024-08-30 13:06:10 +05:30
jw/jwasm
k8/k8s-manifest-sigstore
ka
kc
kd
ke keycastr: added update script (#337745) 2024-09-01 17:49:20 +02:00
kg/kgeotag
ki
kl
km
kn
ko koboldcpp 1.73.1 -> 1.74 (#338587) 2024-09-02 23:09:21 +05:30
kp/kplex
kr
ks
kt
ku kulala-fmt: 1.3.0 -> 1.3.1 2024-08-31 13:28:39 +00:00
kv/kvmarwaita
kx
ky
la treewide: remove refs/tags/ from github release meta.changelog urls (#338301) 2024-09-01 10:53:48 +09:00
lb
lc
ld
le
lg/lgogdownloader
li librewolf-bin: init at 129.0.2.1 (#338466) 2024-09-05 01:19:45 +02:00
lk/lk-jwt-service
ll llama-cpp: 3620 -> 3645 2024-08-30 13:52:39 +00:00
lm lmstudio: 0.3.1 -> 0.3.2 2024-09-02 01:10:09 -05:00
ln/lngen
lo
lp
lr/lrcget
ls
lt/ltris
lu lunacy: 9.6.2 -> 10.0.1 (#338139) 2024-09-04 20:04:36 +00:00
lv/lv_font_conv
lw/lwgrp
lx lxgw-neoxihei: 1.201 -> 1.202 2024-09-04 00:46:11 +00:00
lz
m1/m1ddc
m2
ma marwaita-red: 20.3.1 -> 21 2024-09-03 01:40:52 +00:00
mb
mc
md md-tui: add anas to maintainers 2024-09-03 20:22:24 +08:00
me measureme: 11.0.1 -> 12.0.0 (#338746) 2024-09-03 15:34:25 +00:00
mf
mg
mi clash-meta: 1.18.7 -> 1.18.8 2024-09-02 12:37:02 +00:00
mk
ml/mlx42
mo mongodb-compass: 1.43.6 -> 1.44.0 (#339435) 2024-09-04 10:35:52 +02:00
mp
mq mqttx: 1.9.9 -> 1.10.1 (#337424) 2024-09-02 20:37:21 -04:00
mr/mricron
ms
mu mutter{,43}: Move from gnome scope to top-level 2024-09-01 14:16:31 +02:00
my
n2/n2
n8/n8n
n9/n98-magerun2
na
nb
nc
nd/ndstrim
ne buildDotnetModule: inherit enableParallelBuilding (#339335) 2024-09-03 20:56:37 -07:00
nf
ng
nh nhost-cli: 1.22.3 -> 1.23.0 2024-08-31 21:23:03 +00:00
ni nix-update: 1.5.0 -> 1.5.1 2024-09-04 07:03:36 +00:00
nl
nm nmap: fix liblinear path on darwin 2024-09-03 21:53:26 -05:00
nn
no nomacs: support more formats (#337901) 2024-09-02 06:39:33 +00:00
np
nr
ns
nt
nu nuclei-templates: 9.9.3 -> 9.9.4 2024-09-03 07:25:04 +02:00
nv
nw
nx/nxengine-evo
nz
oa oama: ignore erroneous references on aarch64-darwin 2024-08-30 12:14:49 +02:00
ob obs-cmd: 0.17.6 -> 0.17.7 2024-09-02 02:23:45 +00:00
oc
od
oe/oelint-adv
of
oh
oi oink: 1.2.0 -> 1.2.1 2024-09-03 01:39:53 +00:00
ok
ol ollama: 0.3.5 -> 0.3.9 2024-09-01 14:58:10 -04:00
om
on
oo
op opentelemetry-cpp: fix CMake target include dirs (#328851) 2024-09-04 11:28:34 +08:00
oq/oqs-provider
or ord: 0.19.1 -> 0.20.0 2024-09-04 04:16:02 +00:00
os
ot
ou
ov
ow
pa treewide: remove refs/tags/ from github release meta.changelog urls 2024-08-29 22:45:00 -04:00
pc
pd
pe
pf/pfft
pg
ph
pi picocrypt: 1.41 -> 1.42 2024-09-03 20:10:25 -06:00
pk
pl
pm
pn
po yarnInstallHook: init (#328544) 2024-09-04 14:33:47 -07:00
pp/ppsspp
pq
pr proton-ge-bin: GE-Proton9-11 -> GE-Proton9-12 (#338922) 2024-09-04 20:11:00 +00:00
ps
pt
pu
pv
pw
px/pxder
py pyspread: 2.2.3 -> 2.3 2024-09-03 09:26:19 +00:00
pz/pzip
qa/qadwaitadecorations
qb/qbittorrent-enhanced qbittorrent-enhanced: 4.6.5.10 -> 4.6.6.10 2024-08-30 08:53:30 +00:00
qc/qcm
qd
qg/qgrep
qm/qmplay2
qn/qnial
qo/qodem
qp/qpoases
qq/qq qq: 3.2.12 -> 3.2.12-2024.8.19 2024-09-01 19:36:57 +08:00
qr qrcp: migrate to by-name 2024-09-03 22:51:56 +04:00
qs
qt/qtractor
qu quarkus: 3.13.2 -> 3.14.1 2024-09-01 18:53:48 +00:00
qw/qwerty-fr
r0/r0vm
r1/r10k
ra radicle-node: 1.0.0-rc.14 -> 1.0.0-rc.17 (#338983) 2024-09-04 15:42:55 +02:00
rc rcp: 0.12.0 -> 0.13.0 2024-09-02 17:46:06 +00:00
rd/rdwatool
re buildDotnetModule: inherit enableParallelBuilding (#339335) 2024-09-03 20:56:37 -07:00
rf/rfdump
rh/rHttp
ri Merge master into staging-next 2024-08-30 18:04:02 +00:00
rk
rl/rl_json
rm rmpc: set meta.platforms to linux 2024-08-31 08:40:57 -04:00
rn
ro rospo: init at 0.12.1 (#332753) 2024-09-01 18:23:53 +02:00
rp/rpcs3
rq
rr/rrdtool
rs
rt
ru Merge branch 'master' into add-rutorrent-service 2024-09-03 01:18:16 +00:00
rw/rwpspread
ry ryujinx: disable parallel building 2024-09-04 00:15:55 +03:00
s0/s0ix-selftest-tool
s3
sa
sb
sc scenefx: fix build 2024-09-01 12:30:52 -04:00
sd
se sendme: 0.14.0 -> 0.15.0 2024-09-03 04:07:00 +00:00
sf/sfwbar sfwbar: fix build, missing wayland-scanner 2024-08-31 11:35:00 +02:00
sg/sgfutils
sh
si siyuan: add desktop entry & icon, enable wayland ime (#337021) 2024-09-01 13:37:10 +00:00
sk skia: make use of gnFlags 2024-09-03 13:22:53 +00:00
sl
sm smc-fuzzer: init at 0-unstable-2020-12-23 (#332586) 2024-09-03 22:37:41 +02:00
sn
so sonarr: 4.0.8.1874 -> 4.0.9.2244 (#338719) 2024-09-03 19:54:30 +03:00
sp treewide: remove uses of deprecated Rust functions 2024-09-02 21:48:21 +02:00
sq sqlite_orm: 1.8.2 -> 1.9 2024-08-30 08:58:55 +00:00
sr
ss ssh-openpgp-auth: update comment to refer to nixpkgs-vet 2024-09-03 11:37:24 -07:00
st stevenblack-blocklist: 3.14.100 -> 3.14.104 2024-09-04 18:46:41 +00:00
su surrealdb: fix build (#337916) 2024-08-30 10:29:11 +00:00
sv svt-av1-psy: init at 2.2.1 2024-08-31 10:08:38 +05:30
sw swayimg: 2.3 -> 3.2 (#337114) 2024-09-03 13:10:49 +08:00
sx
sy taler-{sync,challenger}: rename from {sync,challenger} 2024-09-04 12:45:21 +02:00
t-/t-rex
ta taler-{sync,challenger}: rename from {sync,challenger} 2024-09-04 12:45:21 +02:00
tb/tbump
tc
td
te treewide: remove refs/tags/ from github release meta.changelog urls 2024-08-29 22:45:00 -04:00
tg
th
ti tio: 3.6 -> 3.7 2024-08-31 16:27:44 +00:00
tk
tl
tm
to gnome-shell: Move from gnome scope to top-level 2024-09-01 14:16:31 +02:00
tp tpnote: 1.24.7 -> 1.24.8 (#337046) 2024-09-02 20:36:06 -04:00
tr trealla: 2.55.25 -> 2.55.31 2024-09-01 06:24:54 +00:00
ts/tsm-client
tt
tu
tw
tx
ty treewide: remove refs/tags/ from github release meta.changelog urls 2024-08-29 22:45:00 -04:00
u-/u-config
ub
uc
ud
ue
ug
uh/uhttpmock_1_0
ui
um/umpire
un
up upbound: 0.32.1 -> 0.33.0 2024-09-03 20:59:39 +00:00
ur/urban-cli
us userborn: add updateScript 2024-09-04 15:22:36 +02:00
ut
uu/uuu
uv/uv uv: 0.4.3 -> 0.4.4 2024-09-04 17:15:04 +12:00
uw
ux uxn: 1.0-unstable-2024-08-25 -> 1.0-unstable-2024-08-29 2024-09-03 09:15:45 +00:00
va vale-ls: 0.3.7-unstable-2024-03-13 -> 0.3.8 2024-09-02 00:02:05 +02:00
vc
vd/vdhcoapp
ve velero: migrate to by-name 2024-09-01 17:01:01 +04:00
vg
vi vimcats: 1.0.2 -> 1.1.0 2024-09-04 19:28:53 +02:00
vk
vl
vm
vn
vo
vp
vs
vu
vv/vvvvvv
vw/vwsfriend
vz/vzic
wa wayprompt: init at 0.1.2 (#337376) 2024-09-02 18:50:23 +03:00
wb
wc/wcurl
we weblate: move extras from overrides into dependencies, add MIT license 2024-09-04 12:54:31 +02:00
wf/wf-touch
wg/wg-access-server
wh
wi
wl wl-restart: init at 0.2.0 (#337887) 2024-08-31 07:14:26 -07:00
wo
wp
wr/wrangler
ws wstunnel: 10.1.0 - 10.1.1 2024-09-04 15:33:05 +02:00
wt
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
xu/xunit-viewer
xv/xviewer
xw
ya yandex-music: 5.13.2 -> 5.14.0 2024-09-03 00:41:06 +00:00
yc/ycmd
yd/ydotool
ye
yg
yj/yj
yo youki: 0.4.0 -> 0.4.1 2024-09-04 15:07:47 +00:00
ys/ysfx
yt yt-dlg: fix build 2024-09-02 23:35:08 +02:00
yu
za
zb/zbus-xmlgen
zc
ze zed-editor: 0.150.4 -> 0.151.1 2024-09-04 11:34:09 -04:00
zf/zfind
zi zigpy-cli: use buildPythonApplication 2024-09-04 12:02:07 -07:00
zl/zluda
zm/zmkBATx
zo
zp
zs
zu
zw/zwave-js-server
zx
README.md nixpkgs-vet: update CI, docs, and release to 0.1.4 2024-09-03 13:53:25 -07: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. 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-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;
}