1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 11:40:45 +00:00
nixpkgs/pkgs/by-name
2024-03-18 13:53:52 -07:00
..
_4/_4th
_9/_9base
a4/a4
aa aaaaxy: 1.5.23 -> 1.5.42 2024-03-05 01:09:03 +00:00
ab/aba
ac
ad adidnsdump: init at 1.3.1-unstable-2023-12-13 2024-03-17 12:07:20 +01:00
ae
af
ag/ags ags: init at 1.8.0 2024-03-06 18:16:39 +08:00
ai airlift: 0.3.0 -> 0.3.1 2024-03-15 07:19:05 +00:00
al
am amazon-ssm-agent: 3.3.40.0 -> 3.3.131.0 2024-03-12 20:44:29 +00:00
an anytype: 0.38.0 -> 0.39.0 2024-03-12 00:53:16 +00:00
ao/aocl-utils
ap api-linter: 1.63.6 -> 1.64.0 2024-03-05 00:49:25 +00:00
ar arxiv-latex-cleaner: 1.0.4 -> 1.0.5 2024-03-14 10:45:55 +00:00
as asn: move to by-name 2024-03-13 15:07:37 +00:00
at atuin: fix build on x86_64-darwin by updating to apple_sdk_11_0 2024-03-14 23:21:49 -04:00
au Merge pull request #296844 from r-ryantm/auto-update/audiobookshelf 2024-03-18 12:38:16 +00:00
av
aw
ax/axmldec
ay
ba baresip: 3.10.0 -> 3.10.1 2024-03-15 17:37:44 +00:00
bc/bc-ur
be bepass: init at 1.6.2 2024-03-13 15:08:23 +08:00
bi Merge pull request #295355 from amarshall/bitwarden-update 2024-03-12 21:48:41 +01:00
bk/bk
bl blockbench: 4.8.1 -> 4.9.4, refactor 2024-03-16 05:47:48 +02:00
bm/bmake
bn/bngblaster
bo boxbuddy: 2.1.3 -> 2.1.4 2024-03-14 00:31:51 +00:00
bp/bpftop bpftop: 0.2.3 -> 0.3.0 2024-03-18 04:03:14 +00:00
br bruno: 1.10.0 -> 1.11.0 2024-03-16 00:00:59 +00:00
bs/bsync
bu
by
c-
c2 treewide: fix sourceRoot for fetchgit-based src 2024-03-09 07:53:25 +08:00
ca Merge pull request #278968 from katexochen/capslock/init 2024-03-18 09:38:08 +01:00
cb/cbmbasic
cc/ccache
cd
ce certificate-ripper: 2.2.0 -> 2.3.0 2024-03-17 21:22:05 +01:00
cg/cgl
ch
ci cimg: 3.3.4 -> 3.3.5 2024-03-13 23:41:23 +01:00
cl clash-verge-rev: 1.5.8 -> 1.5.9 2024-03-18 20:30:25 +00:00
cm
cn/cntb
co Merge pull request #288632 from ahoneybun/resync-cosmic-files 2024-03-18 21:59:09 +02:00
cp
cr crosswords: init at 0.3.12 2024-03-13 14:08:48 +08:00
cs
ct/ctx
cu/cursewords
cy
cz/czkawka
da
db/dbus-cpp
dc/dc3dd
dd
de dep-scan: 5.2.11 -> 5.2.12 2024-03-12 16:45:18 -05:00
di Merge pull request #264208 from eclairevoyant/dce 2024-03-18 00:02:25 +01:00
dj/djent
dm dmarc-report-converter: 0.7.0 -> 0.7.1 2024-03-13 22:04:38 +00:00
dn/dns2tcp
do doublecmd: 1.1.10 -> 1.1.11 2024-03-14 01:30:55 +00:00
dp/dpp
dr/drone-scp
ds
dt/dtcmp
du
dv/dvb-apps
dx
dy dynamodb-local: 2.2.1 -> 2.3.0 2024-03-15 22:53:34 +00:00
ea/easyeasm
eb
ec
ed
ei Merge pull request #289453 from r-ryantm/auto-update/eiwd 2024-03-07 16:36:20 +01:00
ek/eksctl eksctl: 0.173.0 -> 0.174.0 2024-03-16 01:09:32 +00:00
el
em
en
er
es
et/etlegacy etlegacy: 2.81.1 -> 2.82.0 2024-03-10 10:29:52 +01:00
eu
ex extest: init at 1.0.2 2024-03-04 19:18:20 +11:00
ez/eza eza: 0.18.6 -> 0.18.7 2024-03-14 17:00:18 +01:00
fa fast-float: 6.1.0 -> 6.1.1 2024-03-18 03:01:30 +00:00
fb/fbset
fc
fe feather: 2.6.3 -> 2.6.4 2024-03-11 01:30:36 +00:00
ff
fi files-cli: 2.12.41 -> 2.12.43 2024-03-15 06:05:42 +00:00
fl fleng: 19 -> 20 2024-03-17 00:44:55 +00:00
fm
fn/fnott
fo folio: 24.05 -> 24.06 2024-03-13 00:57:23 +00:00
fr Merge pull request #295614 from Aleksanaa/fretboard 2024-03-14 19:18:26 +01:00
fs fsuae-launcher: 3.1.68 -> 3.1.70 2024-03-10 00:32:55 -03:00
fu/fuchsia-cursor
fw/fwupd fwupd: 1.9.14 -> 1.9.15 2024-03-12 11:45:12 +01:00
fy/fypp
g3/g3kb-switch g3kb-switch: init at 1.4 2024-03-14 10:44:25 +08:00
ga gatus: 5.7.0 -> 5.8.0 2024-03-16 00:55:27 +00:00
gb/gbar
gc
ge
gg/gg gg: init at 0.2.18 2024-03-13 15:09:03 +08:00
gh
gi Merge pull request #296499 from r-ryantm/auto-update/gitu 2024-03-18 05:51:16 +01:00
gl treewide: remove gst-plugins-good missing libsoup_3 workaround 2024-03-08 22:54:25 +08:00
gm Merge pull request #295719 from wegank/gmic-bump 2024-03-14 12:07:18 +01:00
gn gnome-graphs: init at 1.7.2 2024-03-12 18:39:43 +08:00
go go-camo: 2.4.9 -> 2.4.10 2024-03-18 03:01:40 +00:00
gp gpt4all: 2.7.2 -> 2.7.3 2024-03-12 18:14:09 +01:00
gr
gt
gu
gx/gxml
h8/h8mail
ha handlr-regex: 0.9.0 -> 0.10.0 2024-03-17 16:54:08 -04:00
hd/hdrop
he hekatomb: init at 1.5.14-unstable-2024-02-14 2024-03-17 13:06:29 +01:00
hi add the 'HiGHS' solver for linear programs 2024-03-12 22:57:50 +00:00
hj/hjson-go
ho home-manager: unstable-2024-03-12 -> unstable-2024-03-15 2024-03-16 17:25:44 +00:00
ht
hu/hugo hugo: 0.123.8 -> 0.124.0 2024-03-17 01:25:05 +00:00
hy hyprnome: cleanup 2024-03-15 13:40:10 -04:00
i3
ia
ic icewm: 3.4.5 -> 3.4.6 2024-03-08 01:30:31 +00:00
id idb-companion: init at 1.1.8 2024-03-13 13:35:27 +05:30
if/ifrextractor-rs
ig igir: 2.5.0 -> 2.5.2 2024-03-10 01:27:34 +00:00
ii
im impression: 3.0.1 -> 3.1.0 2024-03-14 20:04:44 -07:00
in Merge pull request #296081 from r-ryantm/auto-update/intune-portal 2024-03-16 11:10:03 -07:00
io/ioq3-scion ioq3-scion: init at unstable-2024-03-03 2024-03-04 14:47:46 +00:00
ip iplan: init at 1.9.2 2024-03-14 20:22:51 +08:00
ir/ironbar
it/itch
ja jankyborders: init at 1.6.0 2024-03-15 20:58:52 -05:00
jd/jdt-language-server
ji jigmo: init at 20230816 2024-03-09 04:20:00 +00:00
jj/jj
jn/jnr-posix
jo joshuto: 0.9.6 -> 0.9.8 2024-03-16 07:57:11 +08:00
js/jsoncons
ju just: 1.25.1 -> 1.25.2 2024-03-11 09:11:22 +05:30
ka Merge pull request #292120 from Aleksanaa/kana 2024-03-11 08:06:01 +00:00
kc
kd/kdsingleapplication
ke Merge pull request #287537 from erdnaxe/kernel-hardening-checker 2024-03-08 21:40:56 +01:00
kg/kgeotag
ki kikit: 1.4.0 -> 1.5.0 2024-03-09 20:12:45 -08:00
kl/klog-time-tracker
km kminion: 2.2.6 -> 2.2.7 2024-03-08 06:54:08 +01:00
kn/knossosnet
ko kooha: 2.2.3 -> 2.2.4 2024-03-09 08:31:50 +08:00
kp/kplex
kr krbjack: init at 0-unstable-2024-02-08 2024-03-17 12:19:07 +01:00
ks/kseexpr
kt
ku kubectl-validate: 0.0.1 -> 0.0.3 2024-03-15 09:37:48 +00:00
kx/kxstitch
ky/kyverno-chainsaw kyverno-chainsaw: 0.1.7 -> 0.1.9 2024-03-16 11:41:14 +00:00
la lazymc: 0.2.10 -> 0.2.11 2024-03-17 08:33:10 +00:00
lb
lc/lcab
le lefthook: 1.6.6 -> 1.6.7 2024-03-18 06:51:02 +00:00
li Merge pull request #295519 from Aleksanaa/crosswords 2024-03-14 19:23:32 +01:00
ll llama-cpp: 2424 -> 2454 2024-03-18 12:50:17 +00:00
ln/lngen
lo
lp lprint: init at 1.3.1 2024-03-11 16:58:02 +01:00
ls
lt/ltris
lu lubelogger: 1.2.6 -> 1.2.7 2024-03-17 17:35:20 +00:00
lw/lwgrp
lz
m2
ma mariadb-connector-java: 3.3.0 -> 3.3.3 2024-03-17 23:32:14 +01:00
mb/mbpoll mbpoll: 1.5 -> 1.5.2 2024-03-14 01:31:05 +00:00
mc mcap-cli: 0.0.38 -> 0.0.42 2024-03-15 12:29:39 -07:00
md
me Merge pull request #294334 from ShamrockLee/sourceroot-fix 2024-03-11 16:50:57 +01:00
mf
mg/mgitstatus
mi clash-meta: rename to mihomo (#271658) 2024-03-10 19:46:10 +01:00
mk mkalias: init at 1.0.0 2024-03-16 14:11:47 +11:00
ml/mlx42
mo mountpoint-s3: 1.4.1 -> 1.5.0 2024-03-12 14:14:36 +00:00
mp/mpifileutils
mq mqttui: migrate to by-name 2024-03-05 19:07:08 +04:00
ms
mu
my mystmd: 1.1.46 -> 1.1.47 2024-03-18 06:31:28 +00:00
n2/n2
na namespace-cli: 0.0.348 -> 0.0.350 2024-03-15 17:43:34 +00:00
nb/nbtscan
nc nc4nix: unstable-2023-11-06 -> 0-unstable-2024-03-01 2024-03-04 15:17:52 +01:00
nd/ndstrim ndstrim: init at 0.2.1 2024-03-13 13:11:47 +00:00
ne netscanner: init at 0.4.1 2024-03-12 17:06:40 +03:00
nf/nfft
nh nh: 3.5.4 -> 3.5.7 2024-03-14 21:32:57 +00:00
ni Merge pull request #296062 from aaronjheng/nixops-dns 2024-03-17 16:03:06 +01:00
nl
nm/nmap-parse
nn/nncp
no Merge pull request #294632 from dotlambda/node-hp-scan-to-init 2024-03-12 23:08:01 +00:00
np
nr
ns
nu numbat: 1.10.1 -> 1.11.0 2024-03-10 01:22:50 +00:00
nv
nw Merge pull request #287155 from r-ryantm/auto-update/nwg-hello 2024-03-07 10:04:11 +01:00
oa
ob obs-cmd: init at 0.17.4 2024-03-05 22:43:33 +00:00
oc
oe/oelint-adv
of/offpunk
oh/oh-my-fish
oi oil{,s-for-unix}: 0.20.0 -> 0.21.0 2024-03-14 13:15:09 +01:00
on Merge pull request #291642 from massix/fix/onedriver-systemd 2024-03-04 20:40:54 +01:00
op open-scq30: 1.10.6 -> 1.11.0 2024-03-17 14:28:40 +00:00
or
os
ot oterm: relax aiosqlite constraint 2024-03-07 12:44:10 +01:00
ou
ov
ow/owncloud-client
pa Merge pull request #292826 from cimm/add-payme-package 2024-03-12 10:50:54 +01:00
pd Merge pull request #276732 from eownerdead/pr/pdpmake 2024-03-15 13:15:58 +01:00
pe Merge pull request #296072 from hzeller/feature-20240312-add-perf-to-profile 2024-03-16 21:05:26 -07:00
pf/pfft
pg pg-dump-anon: init at 1.3.1 2024-03-13 16:15:54 +01:00
ph Merge pull request #277980 from eliandoran/dev/photocollage 2024-03-07 22:46:04 +01:00
pi pixi: 0.13.0 -> 0.15.2 2024-03-08 10:52:23 +08:00
pk/pkcrack
pl plumber: 2.5.4 -> 2.6.0 2024-03-15 01:31:36 +00:00
pm
pn pnpm-shell-completion: init at 0.5.3 2024-03-13 07:11:28 -04:00
po
pp/ppsspp
pq pqiv: 2.13 -> 2.13.1 2024-03-11 23:04:26 +00:00
pr pre2k: init at 3.0-unstable-2024-03-14 2024-03-17 13:23:16 +01:00
pt Merge pull request #289111 from Sascha8a/master 2024-03-07 22:40:56 +01:00
pu pupdate: 3.8.0 -> 3.9.0 2024-03-12 19:53:44 +00:00
pw
px/pxder
py pyprland: 2.0.8 -> 2.0.9 2024-03-17 19:26:59 +00:00
pz/pzip
qa/qadwaitadecorations
qc/qcm
qd/qdirstat qdirstat: cleanup 2024-03-13 10:44:35 -04:00
qg/qgrep
qr qrtool: 0.10.5 -> 0.10.6 2024-03-17 15:36:20 +00:00
qs
qt/qtractor
qu quickjs-ng: 0.3.0 -> 0.4.1 2024-03-12 00:29:05 +00:00
ra
rc
rd/rdwatool rdwatool: init at 1.2-unstable-2023-11-27 2024-03-17 14:55:42 +01:00
re renode-dts2repl: unstable-2024-02-29 -> unstable-2024-03-12 2024-03-16 08:09:02 +00:00
ri
rl/rl_json rl_json: use finalAttrs 2024-03-06 12:39:08 +01:00
rm/rmg
ro route-graph: 0.2.0 -> 0.2.1 2024-03-13 21:09:07 +01:00
rp/rpcs3
rq/rqbit
rs
rt/rtl-sdr-osmocom
ru treewide: fix sourceRoot for fetchgit-based src 2024-03-09 07:53:25 +08:00
rw/rwpspread rwpspread: 0.2.3 -> 0.2.4 2024-03-14 15:21:08 +00:00
ry/ryujinx ryujinx: 1.1.1223 -> 1.1.1231 2024-03-15 17:25:17 +00:00
s3 s3proxy: skip tests on Darwin 2024-03-14 08:33:57 +00:00
sa salmon: 1.10.2 -> 1.10.3 2024-03-17 23:24:42 +01:00
sc scrutiny-collector: add nix-update-script 2024-03-18 08:33:55 +00:00
sd
se Merge pull request #294423 from r-ryantm/auto-update/sesh 2024-03-11 11:18:57 -04:00
sg/sgfutils
sh shopware-cli: 0.4.28 -> 0.4.29 2024-03-14 02:49:50 +00:00
si signal-export: 1.8.1 -> 1.8.2 2024-03-16 02:23:54 +00:00
sl
sm smlfut: 1.2.0 -> 1.3.0 2024-03-17 09:13:55 +00:00
sn snipe-it: 6.3.1 -> 6.3.3 2024-03-11 18:16:36 +01:00
so sophus: init at 1.22.10 2024-03-10 13:23:16 -03:00
sp spicetify-cli: 2.34.0 -> 2.34.1 2024-03-16 10:36:31 +00:00
sq squirreldisk: add missing desktop item 2024-03-06 01:45:51 +01:00
sr srm-cuarzo: 0.5.4-1 -> 0.5.5-1 2024-03-17 02:31:16 +00:00
ss sshd-openpgp-auth: init at 0.3.0 2024-03-10 20:49:28 +02:00
st steamguard-cli: 0.12.6 -> 0.13.0 2024-03-05 02:42:11 +00:00
su Merge pull request #273272 from kugland/subtitlecomposer 2024-03-05 04:07:01 +00:00
sv treewide: fix sourceRoot for fetchgit-based src 2024-03-09 07:53:25 +08:00
sw swww: cleanup 2024-03-16 15:52:50 -04:00
sx
sy syncstorage-rs: move to by-name 2024-03-17 12:11:35 +01:00
t-/t-rex t-rex: migrate to by-name 2024-03-12 00:10:19 +04:00
ta Merge pull request #292527 from massix/feat/add-tana 2024-03-13 10:10:07 -07:00
tc/tcsh tcsh: 6.24.10 -> 6.24.11 2024-03-14 12:25:16 +00:00
td/tdl
te tenki: 1.4.0 -> 1.5.0 2024-03-18 09:49:26 +00:00
tg/tgpt tgpt: 2.7.1 -> 2.7.2 2024-03-17 22:33:27 +01:00
th
ti tilemaker: migrate to by-name 2024-03-14 18:39:43 +04:00
tk/tkdiff
tl
tm/tmuxifier
to treewide: fix sourceRoot for fetchgit-based src 2024-03-09 07:53:25 +08:00
tp tpnote: init at 1.23.9 2024-03-13 20:15:33 +02:00
tr treedome: 0.4.2 -> 0.4.3 2024-03-12 13:18:41 +07:00
tt/ttop
tu
tx/txr
ty typst-preview: 0.10.8 -> 0.11.1 2024-03-18 17:26:14 +01:00
uc
ud
ue
ui
um/umpire
un unciv: move to pkgs/by-name 2024-03-17 01:32:23 +01:00
up
us/usql
ut ut1999: init at 469d 2024-03-04 23:27:59 +02:00
uu/uuu
uv/uv uv: 0.1.19 -> 0.1.21 2024-03-14 04:20:00 +00:00
ux/uxn uxn: unstable-2024-03-10 -> unstable-2024-03-16 2024-03-17 05:56:32 +00:00
va varia: init at 2024.2.29-2 2024-03-11 10:33:49 +08:00
vc
ve
vg/vgm2x
vi VictoriaMetrics: re-include vmalert 2024-03-17 14:13:35 +00:00
vl vlc-bin: add pcasaretto to meta.maintainers 2024-03-05 22:26:46 -03:00
vu/vulkan-volk
wa Merge pull request #296333 from a-n-n-a-l-e-e/warp-drop-nix-prefetch-url 2024-03-18 09:01:41 -07:00
wb/wb32-dfu-updater
we
wh whistle: 2.9.65 -> 2.9.66 2024-03-11 01:11:00 +00:00
wi wit-bindgen: 0.21.0 -> 0.22.0 2024-03-12 02:15:06 +00:00
wl wl-clipboard-rs: add myself as maintainer 2024-03-16 10:56:59 -04:00
wo worker: 5.0.1 -> 5.0.2 2024-03-12 12:38:15 +00:00
wp/wp-cli wp-cli: add changelog to meta 2024-03-17 09:33:23 +01:00
ws wslu: 4.1.1 -> 4.1.2 2024-03-11 02:46:33 +00:00
wt/wtfis
x1/x16
x5/x509-limbo x509-limbo: init at unstable-2024-03-13 2024-03-16 00:06:01 +00:00
xa/xarcan
xc
xd xdg-user-dirs: set meta.mainProgram 2024-03-13 05:25:03 -04:00
xf/xfs-undelete
xi xiu: 0.12.4 -> 0.12.5 2024-03-16 02:53:37 +00:00
xm
xo xonsh: 0.14.4 -> 0.15.1 2024-03-09 10:24:17 +08:00
xp/xplr
xr/xr-hardware
xs
xw/xwayland-run
ya yamlscript: 0.1.40 -> 0.1.41 2024-03-12 06:16:43 +00:00
ye
yg/yggdrasil
yj/yj
yo youtrack: 2023.3.24329 -> 2024.1.25893 2024-03-06 22:50:04 +01:00
ys/ysfx
yt yt-dlg: init at 1.8.5 2024-03-17 08:11:10 +01:00
yu/yunfaavatar
za Merge pull request #278273 from gador/zabbix-agent2-plugin-postgresql 2024-03-05 00:37:42 +01:00
zb/zbus-xmlgen
zc/zcfan
ze/zesarux
zi
zo/zola
zp
zs zsync: migrate to by-name 2024-03-08 23:16:38 +01: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

$ ./pkgs/test/nixpkgs-check-by-name/scripts/run-local.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;