nixpkgs/pkgs/by-name
Gaétan Lepage 406e7f30bf
Merge pull request #334621 from kiike/update/basedpyright
basedpyright: 1.15.2 -> 1.16.0
2024-08-14 21:12:58 +02:00
..
_0/_0xpropo
_2/_2ship2harkinian
_4
_6/_64gram
_9/_9base
a4/a4
a5/a52dec
aa
ab Merge pull request #330368 from natsukium/abpoa/update 2024-08-13 21:29:42 -04:00
ac
ad Merge pull request #331396 from NickCao/telegram-desktop 2024-08-11 10:45:00 -04:00
ae Merge pull request #332674 from supinie/aerogramme 2024-08-08 19:35:36 +02:00
af affine: 0.15.7 -> 0.16.0 2024-08-09 21:15:36 -03:00
ag
ai
al alpaca: 1.0.5 -> 1.0.6 2024-08-08 18:08:06 +08:00
am
an Merge pull request #333097 from pyrox0/pythonpackages/ansible-navigator 2024-08-10 00:17:49 +09:00
ao/aocl-utils
ap application-title-bar: 0.6.9 -> 0.7.0 2024-08-11 21:27:48 +00:00
aq/aquamarine aquamarine: 0.2.0 -> 0.3.1 2024-08-12 18:00:44 +03:00
ar Merge pull request #334163 from SFrijters/arduino-cli-1.0.4 2024-08-14 03:11:27 +00:00
as
at attic-client,attic-server: 0-unstable-2024-02-08 -> 0-unstable-2024-08-01 2024-08-13 12:14:15 +02:00
au Merge pull request #333413 from r-ryantm/auto-update/autoprefixer 2024-08-11 00:30:51 +02:00
av
aw
ax
ay
az
b3/b3sum
ba basedpyright: 1.15.2 -> 1.16.0 2024-08-14 15:26:00 +02:00
bc
bd
be
bi binary: 0.3.1 -> 4.0 2024-08-09 09:31:29 +00:00
bk/bk
bl bluetuith: 0.2.2 -> 0.2.3 2024-08-14 06:00:49 +00:00
bm/bmake
bn/bngblaster
bo bombsquad: 1.7.36 -> 1.7.37 2024-08-09 11:57:28 +00:00
bp
bq/bqn
br bruno: 1.23.1 -> 1.24.0 2024-08-12 17:14:03 +00:00
bs
bt
bu bugstalker: 0.1.4 -> 0.2.2 2024-08-14 13:37:32 +02:00
by
c-
c2
ca casadi: always set PYTHON_PREFIX, using placeholder "out". 2024-08-13 20:58:02 +03:00
cb
cc
cd
ce centerpiece: 1.1.0 -> 1.1.1 2024-08-11 13:05:59 +00:00
cg
ch charmcraft: 3.1.1 -> 3.1.2 2024-08-14 02:33:51 +00:00
ci Merge pull request #332619 from r-ryantm/auto-update/cinny-unwrapped 2024-08-14 03:09:40 +00:00
cj/cjs
cl Merge pull request #332621 from r-ryantm/auto-update/cloudflare-utils 2024-08-14 04:26:13 +00:00
cm
cn cnsprcy: init at 0.2.0 2024-08-09 13:55:07 +01:00
co Merge master into staging-next 2024-08-14 06:01:07 +00:00
cp cpuinfo: 0-unstable-2024-07-10 -> 0-unstable-2024-08-07 2024-08-12 01:56:02 +00:00
cq/cq
cr crawley: 1.7.7 -> 1.7.8 2024-08-13 12:09:40 +00:00
cs
ct/ctx
cu
cv/cvemap
cy
cz/czkawka
da
db
dc
dd ddns-updater: disable updates 2024-08-12 19:44:01 +00:00
de Merge pull request #331770 from pbsds/fix-sourceRoot-1722602716 2024-08-09 04:41:06 +02:00
dg/dgoss
dh/dhcpig
di dissent: 0.0.26 -> 0.0.27 2024-08-11 01:32:43 +00:00
dj/djent
dm
dn
do dopamine: 3.0.0-preview.29 -> 3.0.0-preview.31 2024-08-14 07:51:52 +00:00
dp
dr
ds dsda-doom: 0.27.5 -> 0.28.0 2024-08-10 20:02:07 +02:00
dt
du
dv/dvb-apps
dw/dwl
dx
dy
e1/e1s
ea
eb
ec
ed
ee/eepers
ef/efibootmgr
eg/eg25-manager
ei eigenlayer: 0.9.2 -> 0.9.3 2024-08-08 17:52:56 +00:00
ej/ejsonkms
ek/eksctl
el
em
en
eo/eog
ep
er
es
et
eu
ev
ew/eww eww: 0.6.0-unstable-2024-04-26 -> 0.6.0-unstable-2024-07-05 2024-08-11 22:46:41 +02:00
ex
ey/eyewitness
ez/eza eza: 0.18.24 -> 0.19.0 2024-08-08 06:48:25 +02:00
f2/f2fs-tools
fa fastfetch: 2.21.0 -> 2.21.2 2024-08-13 23:11:52 -05:00
fb/fbset
fc fcitx5-pinyin-moegirl: 20240709 -> 20240809 2024-08-10 00:14:05 +08:00
fe fedimint: 0.3.3 -> 0.4.1 2024-08-14 13:37:21 +02:00
ff fflogs: 8.12.0 -> 8.12.19 2024-08-12 04:22:54 +00:00
fg/fgqcanvas
fi filterpath: 1.0.1 -> 1.0.2 2024-08-14 04:28:07 +00:00
fj/fjo
fl Merge pull request #333264 from r-ryantm/auto-update/flameshot 2024-08-13 16:16:56 -04:00
fm
fn/fnott fnott: 1.6.0 -> 1.7.0 2024-08-09 12:54:39 -07:00
fo Merge pull request #333198 from isabelroses/forgejo-cli 2024-08-13 17:10:13 +02:00
fr frankenphp: 1.2.3 -> 1.2.4 2024-08-14 09:37:09 +00:00
fs
ft/fte
fu
fv
fw/fwupd
fx/fx
fy
fz
g3/g3kb-switch
ga gate: 0.38.2 -> 0.39.2 2024-08-11 10:25:15 +00:00
gb
gc
gd
ge gerrit: 3.10.0 -> 3.10.1 2024-08-10 13:07:58 +02:00
gf
gg/gg
gh gh-dash: 4.5.0 -> 4.5.2 2024-08-12 05:41:49 +00:00
gi git-gamble: init at 2.9.0 2024-08-12 20:51:17 +02:00
gk/gk-cli gk-cli: init at 2.1.1 2024-08-08 21:13:51 +02:00
gl glance: 0.5.0 -> 0.5.1 2024-08-12 18:01:21 +00:00
gm
gn
go gossip: move hash to last attribute 2024-08-14 09:54:34 +02:00
gp
gr grype: 0.79.4 -> 0.79.5 2024-08-10 17:46:53 +00:00
gt
gu
gv/gvisor
gx/gxml
h2/h2
h5/h5utils
h8/h8mail
ha Merge pull request #333790 from r-ryantm/auto-update/hadolint-sarif 2024-08-11 19:54:29 +02:00
hb/hb-honeypot
hc/hclfmt
hd
he
hi hickory-dns: rename from trust-dns 2024-08-11 07:59:32 +00:00
hj/hjson-go
hn/hn-text
ho home-manager: 0-unstable-2024-08-02 -> 0-unstable-2024-08-11 2024-08-13 14:35:30 +00:00
hp hpipm: use blasfeo CMake export 2024-08-12 15:25:43 +02:00
ht htcondor: 23.8.1 -> 23.9.6 2024-08-09 01:13:37 +00:00
hu hugo: 0.131.0 -> 0.132.1 2024-08-13 20:26:26 +08:00
hv/hvm
hy Merge pull request #333543 from donovanglover/bump-hyprnome 2024-08-12 21:03:22 +00:00
i2/i2p
i3
ia
ic
id
if/ifrextractor-rs
ig
ii iir1: 1.9.4 -> 1.9.5 2024-08-12 13:28:18 +00:00
ij ijq: move to pkgs/by-name 2024-08-11 09:18:50 -05:00
im
in nixos/incus-agent: init 2024-08-10 12:08:33 -04:00
io
ip
ir ironbar: 0.15.1 -> 0.16.0 2024-08-10 11:07:47 -04:00
is
it
iv Merge pull request #325089 from feathecutie/inko 2024-08-08 19:40:48 +02:00
iw/iw
iz/izrss
ja
jc/jcli
jd/jdt-language-server jdt-language-server: 1.37.0 -> 1.38.0 2024-08-08 09:12:23 +00:00
je
ji
jj/jj
jn jnv: 0.3.0 -> 0.4.0 2024-08-13 14:47:43 +00:00
jo joshuto: 0.9.8 -> 0.9.8-unstable-2024-07-20 2024-08-13 14:25:35 +02:00
jq/jq-zsh-plugin
jr/jrl-cmakemodules
js Merge pull request #331770 from pbsds/fix-sourceRoot-1722602716 2024-08-09 04:41:06 +02:00
jt/jtdx
ju
jw/jwasm
ka kakoune-lsp: 17.0.1 -> 17.1.1 2024-08-12 14:50:54 -07:00
kc kcl: 0.9.3 -> 0.9.7 2024-08-09 09:33:10 +00:00
kd
ke Merge pull request #332921 from ofalvai/keepassxc-go-unbreak-darwin 2024-08-13 11:04:30 +02:00
kg/kgeotag
ki
kl
km
kn
ko Merge pull request #332693 from astro/kolla 2024-08-08 17:40:17 +02:00
kp/kplex
kr
ks
kt
ku kulala-fmt: 1.2.0 -> 1.3.0 2024-08-13 14:50:48 +00:00
kv/kvmarwaita
kx
ky
la
lb
lc lc0: 0.31.0 -> 0.31.1 2024-08-11 13:42:10 +00:00
ld
le ledger-autosync: move to pkgs/by-name 2024-08-12 12:11:32 -07:00
lg/lgogdownloader
li Merge pull request #334512 from r-ryantm/auto-update/litmusctl 2024-08-14 15:03:59 -04:00
lk/lk-jwt-service
ll llama-cpp: 3499 -> 3565 2024-08-10 20:56:53 +00:00
lm
ln/lngen
lo Merge pull request #331824 from yzx9/logseq-drawin-support 2024-08-13 18:30:53 +10:00
lp
lr/lrcget lrcget: add maintainer Scrumplex 2024-08-11 20:30:21 +03:00
ls
lt/ltris
lu lunar-client: 3.2.12 -> 3.2.15 2024-08-14 11:40:30 +00:00
lv/lv_font_conv
lw/lwgrp
lx treewide: remove lxc team from lxd packages and modules 2024-08-10 13:23:38 -04:00
lz
m1/m1ddc
m2
ma Merge pull request #333724 from zimward/mangareader 2024-08-14 17:24:23 +00:00
mb
mc Revert "mcumgr-client.updateScript: drop" 2024-08-09 09:14:44 +02:00
md mdbook-yml-header: package is built from source 2024-08-11 16:11:37 +02:00
me Merge master into staging-next 2024-08-14 00:02:32 +00:00
mf
mg
mi minijinja: 2.1.1 -> 2.1.2 2024-08-12 09:37:10 +00:00
mk
ml/mlx42
mo mountpoint-s3: 1.6.0 -> 1.8.0 2024-08-12 17:31:38 +02:00
mp
mq
mr/mricron
ms
mu mumps: build on darwin 2024-08-12 15:25:42 +02:00
my Merge pull request #331616 from LeSuisse/mysql84-8.4.2 2024-08-13 21:39:37 -04:00
n2/n2
n8/n8n
n9/n98-magerun2 n98-magerun2: move to by-name 2024-08-11 15:54:46 +02:00
na namespace-cli: 0.0.388 -> 0.0.389 2024-08-13 15:23:39 +00:00
nb
nc
nd/ndstrim
ne Merge pull request #331355 from MattSturgeon/nexus-refactor-unfree 2024-08-14 11:48:06 -03:00
nf
ng
nh nh: 3.5.19 -> 3.5.21 2024-08-10 21:43:33 +00:00
ni Merge pull request #327168 from Mic92/nix-ld 2024-08-14 20:09:18 +02:00
nl
nm
nn
no noto-fonts-cjk-serif: 2.002 -> 2.003 2024-08-09 05:14:58 +00:00
np npiet: add package tests 2024-08-12 23:44:48 +02:00
nr
ns
nt
nu
nv
nw nwjs-ffmpeg-prebuilt: 0.89.0 -> 0.90.0 2024-08-10 13:13:29 +00:00
nx/nxengine-evo
nz/nzbhydra2 nzbhydra2: 7.3.0 -> 7.4.0 2024-08-11 01:25:35 +00:00
oa
ob
oc
od
oe/oelint-adv
of offat: 0.19.1 -> 0.19.3 2024-08-09 03:20:34 +00:00
oh Merge pull request #329314 from redyf/update-oh-my-posh 2024-08-14 02:11:38 +02:00
oi
ok okteto: 2.29.3 -> 2.30.1 2024-08-14 04:31:57 +00:00
ol ollama: only run service test on linux 2024-08-13 09:37:35 -04:00
om
on
oo
op open62541: 1.4.2 -> 1.4.4 2024-08-13 17:45:20 +02:00
oq/oqs-provider
or
os
ot
ou
ov
ow
pa Merge master into staging-next 2024-08-12 06:01:03 +00:00
pc
pd
pe peergos: 0.18.0 -> 0.19.0 2024-08-10 03:24:33 +00:00
pf/pfft
pg
ph phpunit: 11.3.0 -> 11.3.1 2024-08-14 17:23:42 +00:00
pi Merge pull request #333063 from ryand56/update/picocrypt 2024-08-13 09:26:05 +02:00
pk
pl platformsh: 5.0.16 -> 5.0.18 2024-08-11 06:32:47 +00:00
pm
pn
po Merge pull request #328817 from r-ryantm/auto-update/poethepoet 2024-08-13 21:22:14 -04:00
pp/ppsspp
pq
pr proxsuite: disable a failing test on aarch64-linux 2024-08-13 21:24:53 +02:00
ps
pt
pu pupdate: 3.11.0 -> 3.11.1 2024-08-08 06:41:32 +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-26740 -> 3.2.12 2024-08-10 22:14:01 +00:00
qr
qs
qt/qtractor
qu quarkus: 3.13.0 -> 3.13.2 2024-08-11 22:50:13 +00:00
qw/qwerty-fr
r0/r0vm
r1/r10k
ra railway: 3.11.2 -> 3.11.4 2024-08-10 13:15:35 +00:00
rc
rd/rdwatool
re renovate: 38.18.17 -> 38.27.0 2024-08-14 04:17:56 +00:00
rf/rfdump
rh/rHttp
ri
rk
rl/rl_json
rm
rn
ro Merge pull request #334211 from r-ryantm/auto-update/roddhjav-apparmor-rules 2024-08-13 08:11:50 +05:30
rp/rpcs3 rpcs3: 0.0.32-16711-501e9260b -> 0.0.32-16784-03a612487 2024-08-09 04:24:36 +00:00
rq
rr/rrdtool
rs
rt rtorrent: 0.9.8-unstable-2023-03-16 -> 0.9.8-unstable-2024-08-09 2024-08-10 03:51:47 +00:00
ru Merge pull request #331757 from alyssais/rustic 2024-08-14 09:01:56 +02:00
rw/rwpspread
ry ryujinx: 1.1.1364 -> 1.1.1373 2024-08-12 00:56:07 +00:00
s0/s0ix-selftest-tool
s3
sa Merge pull request #333061 from wegank/sarasa-gothic-bump 2024-08-11 21:53:59 +02:00
sb
sc screenly-cli: format with nixfmt-rfc-style 2024-08-13 14:28:21 +01:00
sd sd-mux-ctrl: update homepage 2024-08-07 20:36:20 -07:00
se
sf/sfwbar
sg/sgfutils
sh Merge pull request #333115 from ryand56/update/sherlock 2024-08-14 04:12:52 +00:00
si Merge pull request #332048 from r-ryantm/auto-update/silverbullet 2024-08-13 21:41:49 -04:00
sk Merge pull request #333373 from r-ryantm/auto-update/sketchybar-app-font 2024-08-13 16:10:17 -04:00
sl slimserver: Fix bug in scanner 2024-08-14 14:15:42 +02:00
sm
sn snes9x: add sugar700 to maintainer list 2024-08-10 14:31:31 +02:00
so Merge pull request #273296 from integrated-reasoning/soplex 2024-08-11 11:41:20 +01:00
sp Merge pull request #334584 from r-ryantm/auto-update/spicetify-cli 2024-08-14 15:06:26 -04:00
sq
sr Merge pull request #331331 from donovanglover/srb2-libglu 2024-08-11 15:46:19 +00:00
ss
st stevenblack-blocklist: 3.14.90 -> 3.14.95 2024-08-09 04:59:27 +00:00
su Merge pull request #333696 from paveloom/subtitleedit 2024-08-14 17:28:52 +00:00
sv svix-server: 1.13.0 -> 1.28.0 2024-08-11 22:41:58 +02:00
sw
sx
sy symbolicator: 23.11.2 -> 24.7.1 2024-08-14 13:38:17 +02:00
t-/t-rex
ta
tb/tbump
tc
td
te Merge pull request #334357 from r-ryantm/auto-update/terraform-local 2024-08-14 10:16:22 +00:00
tg
th
ti tinymist: add GaetanLepage to maintainers 2024-08-13 13:31:54 +02:00
tk
tl
tm
to
tp
tr tracexec: 0.5.1 -> 0.5.2 2024-08-13 09:43:26 +00:00
ts/tsm-client
tt
tu tuxmux: change tuxmux version to correct format 2024-08-12 21:26:15 -04:00
tw
tx
ty typst: patch Cargo.lock for Rust 1.80 2024-08-09 21:26:51 +01:00
ub ubuntu-sans: 1.004 -> 1.006 2024-08-09 00:40:21 +00:00
uc
ud
ue
ug
uh/uhttpmock_1_0
ui
um/umpire
un
up
ur/urban-cli
us
ut
uu/uuu
uv/uv
uw uwsm: 0.17.4 -> 0.18.0 2024-08-10 13:00:12 +05:30
ux
va vault-unseal: 0.5.1 -> 0.6.0 2024-08-08 15:17:41 +00:00
vc Merge pull request #327790 from r-ryantm/auto-update/vcpkg 2024-08-13 23:11:52 -04:00
vd/vdhcoapp
ve Merge pull request #267239 from rnhmjoj/pr-veloren 2024-08-09 10:18:53 +02:00
vg/vgm2x
vi virtio-win: 0.1.248-1 -> 0.1.262-2 2024-08-09 08:18:33 +00:00
vk
vl
vm
vn
vo
vp
vs
vu
vv/vvvvvv
vw/vwsfriend
vz/vzic
wa Merge master into staging-next 2024-08-13 18:01:28 +00:00
wb
wc/wcurl
we weblate: init at 5.6.2 2024-08-13 08:44:54 +02:00
wf/wf-touch
wg/wg-access-server
wh
wi wit-bindgen: 0.29.0 -> 0.30.0 2024-08-13 04:52:47 +00:00
wl wlx-overlay-s: format using nixfmt 2024-08-12 23:04:07 +02:00
wo
wp
wr/wrangler
ws
wt
wv
wx/wxc
wy/wyoming-satellite
x1/x16
x5/x509-limbo
xa
xc
xd
xe
xf/xfs-undelete
xh/xhosts
xi xiu: 0.12.7 -> 0.13.0 2024-08-11 03:15:22 +00:00
xl
xm xmoji: init at 0.5.1 2024-08-10 17:01:32 +02:00
xn/xnlinkfinder
xo
xp
xr
xs
xu/xunit-viewer
xv/xviewer
xw
ya yamlscript: 0.1.69 -> 0.1.71 2024-08-13 11:01:22 +00:00
yc/ycmd
yd/ydotool
ye yeahconsole: init at 0.1.3 2024-08-12 15:55:18 +02:00
yg yggdrasil: 0.5.7 -> 0.5.8 2024-08-13 08:25:39 +00:00
yj/yj
yo
ys/ysfx
yt ytmdesktop: StartupWMClass, desktopName Capitalisation 2024-08-10 19:16:03 +02:00
yu
za
zb/zbus-xmlgen
zc/zcfan
ze zed-editor: 0.146.5 -> 0.147.2 2024-08-08 10:15:22 +02:00
zf/zfind
zi zitadel: 2.42.10 -> 2.58.3 2024-08-09 23:45:19 +02:00
zl/zluda
zm/zmkBATx
zo
zp
zs
zu
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;
}