nixpkgs/pkgs/by-name
Aleksana a07da9722d
Merge pull request #330664 from Mic92/empty-with
treewide: remove unused `with` statements from maintainer lists
2024-07-29 15:01:57 +08:00
..
_0/_0xpropo
_2/_2ship2harkinian
_4 treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
_6/_64gram
_9/_9base
a4/a4
a5/a52dec
aa
ab
ac
ad
ae treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
af
ag
ai
al
am
an ananicy-cpp: make bpf support optional 2024-07-28 01:16:48 +05:30
ao/aocl-utils
ap
aq/aquamarine
ar Merge pull request #324545 from paparodeo/treewide-strict-deps-fixes 2024-07-27 22:19:23 +03:00
as
at
au
av
aw
ax
ay
az
b3/b3sum
ba
bc
bd
be treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
bi
bk/bk
bl
bm/bmake
bn/bngblaster
bo
bp
bq/bqn
br
bs Merge pull request #327006 from Sigmanificient/bsc 2024-07-28 21:59:08 +02:00
bt
bu
by
c2
c-
ca Merge pull request #326497 from getchoo/pkgs/cartridges/search-provider 2024-07-29 00:36:51 +02:00
cb
cc
cd
ce treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
cg
ch
ci
cj/cjs cjs: fix cross compilation, set strictDeps 2024-07-27 15:47:48 -04:00
cl treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
cm
cn/cntb
co
cp
cq/cq
cr treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
cs
ct/ctx
cu treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
cv/cvemap
cy
cz/czkawka
da
db
dc
dd
de
dg/dgoss
dh/dhcpig
di
dj/djent
dm
dn
do treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
dp
dr Merge pull request #219942 from vsharathchandra/druid_nix_module 2024-07-28 11:02:06 +02:00
ds
dt
du
dv/dvb-apps
dx
dy
e1/e1s
ea
eb
ec
ed
ee/eepers
ef/efibootmgr
ei
ej/ejsonkms
ek/eksctl
el
em
en
eo/eog
ep
er
es
et
eu
ev
ew/eww
ex ext4fuse: init at 0.1.3 2024-07-27 23:21:01 +02:00
ey/eyewitness
ez/eza
f2/f2fs-tools
fa Merge pull request #330664 from Mic92/empty-with 2024-07-29 15:01:57 +08:00
fb/fbset
fc
fe
ff treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
fg/fgqcanvas treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
fi
fj/fjo
fl
fm
fn/fnott
fo
fr treewide: remove viric from meta.maintainers [no orphans] 2024-07-28 10:47:12 -03:00
fs
ft/fte
fu
fv
fw/fwupd
fx/fx
fy/fypp
fz fzf: 0.54.1 -> 0.54.2 2024-07-27 19:36:15 +02:00
g3/g3kb-switch
ga
gb
gc
gd
ge
gf
gg/gg
gh
gi git-igitt: init at 0.1.18 2024-07-28 15:34:28 +02:00
gl
gm
gn treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
go google-chrome: add changelog link to make it easier for reviewers 2024-07-28 23:37:37 +05:30
gp
gr
gt
gu
gv/gvisor
gx/gxml
h2/h2
h5/h5utils
h8/h8mail
ha Merge pull request #312213 from onemoresuza/hare-refactor-cross-comp-tests 2024-07-28 23:40:44 +02:00
hb/hb-honeypot
hd
he
hi treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
hj/hjson-go
hn/hn-text
ho
hp/hpp2plantuml
ht treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
hu
hv/hvm
hy
i2/i2p
i3
ia
ic
id
if/ifrextractor-rs
ig
ii
ij/ijhttp
im Merge pull request #323501 from eclairevoyant/imhex-fix 2024-07-29 07:40:53 +02:00
in
io
ip treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
ir treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
is treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
it
iv/iverilog
iw/iw
iz/izrss
ja treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
jd/jdt-language-server
je
ji
jj/jj
jn
jo
jq/jq-zsh-plugin
jr/jrl-cmakemodules
js
jt/jtdx
ju
jw/jwasm
ka
kc
kd
ke
kg/kgeotag
ki
kl
km
kn
ko
kp/kplex
kr
ks
kt treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
ku
kv/kvmarwaita
kx
ky
la
lb
lc
ld
le lexical: 0.6.1 -> 0.7.0 2024-07-28 22:53:40 +02:00
lg/lgogdownloader
li treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
lk/lk-jwt-service
ll Merge pull request #326131 from nwhirschfeld/lldap-cli 2024-07-28 22:40:10 +02:00
lm
ln/lngen
lo treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
lp treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
ls
lt/ltris
lu
lv/lv_font_conv
lw/lwgrp
lx
lz
m1/m1ddc
m2
ma treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
mb
mc
md md-tui: 0.8.1 -> 0.8.3 2024-07-28 14:12:40 +02:00
me Merge remote-tracking branch 'origin/master' into staging-next 2024-07-28 01:04:35 +03:00
mf
mg
mi Merge pull request #330637 from r-ryantm/auto-update/clash-meta 2024-07-28 22:04:21 +02:00
mk
ml/mlx42
mo treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
mp
mq
mr/mricron
ms
mu
my
n2/n2
n8/n8n
na
nb treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
nc
nd/ndstrim
ne treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
nf
ng
nh treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
ni
nl
nm
nn
no
np
nr
ns
nt
nu
nv
nw nwg-panel: 0.9.34 -> 0.9.36 2024-07-27 18:18:14 +00:00
nx/nxengine-evo
oa
ob obj-magic: init at unstable-2020-09-20 (#306627) 2024-07-28 22:33:37 +02:00
oc
od
oe/oelint-adv
of offat: 0.18.0 -> 0.19.1 2024-07-28 04:44:27 +00:00
oh treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
oi
ok/okolors
ol
om
on
oo
op Merge pull request #329122 from r-ryantm/auto-update/openvas-scanner 2024-07-28 23:59:34 +02:00
or
os
ot
ou
ov
ow
pa treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
pc
pd
pe treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
pf/pfft
pg treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
ph
pi Merge pull request #330719 from NickCao/picom 2024-07-29 01:04:49 +02:00
pk
pl Merge pull request #329669 from HeitorAugustoLN/plasma-panel-colorizer 2024-07-28 19:43:38 +02:00
pm
pn
po treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
pp/ppsspp
pq
pr treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
ps
pt
pu pupdate: 3.10.3 -> 3.11.0 2024-07-27 14:50:37 +00:00
pv
pw
px/pxder
py
pz/pzip
qa/qadwaitadecorations
qb/qbittorrent-enhanced
qc/qcm
qd
qg/qgrep
qn/qnial
qo/qodem
qp/qpoases
qr
qs
qt/qtractor
qu treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
qw/qwerty-fr
r0/r0vm
r1/r10k
ra
rc
rd/rdwatool
re treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
rh/rHttp
ri Merge remote-tracking branch 'origin/master' into staging-next 2024-07-28 01:04:35 +03:00
rk
rl/rl_json
rm rmpc: init at 0.2.1 2024-07-27 20:28:19 -04:00
rn
ro
rp/rpcs3
rq
rs
rt
ru
rw/rwpspread
ry
s0/s0ix-selftest-tool
s3
sa sarasa-gothic: 1.0.15 -> 1.0.16 2024-07-27 14:30:28 +00:00
sb
sc
sd
se treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
sf/sfwbar
sg/sgfutils
sh
si
sk Merge pull request #330664 from Mic92/empty-with 2024-07-29 15:01:57 +08:00
sl
sm Merge pull request #330378 from Aleksanaa/smile 2024-07-28 10:58:00 +02:00
sn
so
sp
sq sqlite-vss: mark broken 2024-07-27 19:51:14 +00:00
sr treewide: remove viric from meta.maintainers [no orphans] 2024-07-28 10:47:12 -03:00
ss
st Merge pull request #329241 from r-ryantm/auto-update/stu 2024-07-29 08:41:45 +02:00
su
sv treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
sw
sx
sy Merge pull request #330664 from Mic92/empty-with 2024-07-29 15:01:57 +08:00
t-/t-rex
ta Merge pull request #320800 from xanderio/tailscale-gitops-pusher 2024-07-28 23:22:49 +02:00
tb/tbump
tc/tcsh
td
te Merge pull request #330579 from r-ryantm/auto-update/tenv 2024-07-28 10:43:11 -04:00
tg
th treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
ti treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
tk
tl
tm
to
tp
tr treewide: remove viric from meta.maintainers [no orphans] 2024-07-28 10:47:12 -03:00
ts/tsm-client
tt
tu
tw
tx/txr
ty
ub ubuntu-sans-mono: 1.004 -> 1.006 2024-07-28 04:07:34 +00:00
uc
ud
ue
ug
uh/uhttpmock_1_0
ui
um/umpire
un treewide: remove viric from meta.maintainers [no orphans] 2024-07-28 10:47:12 -03:00
up
ur/urban-cli
us
ut
uu/uuu
uv/uv
uw
ux
va Merge pull request #329794 from ThePuzzlemaker/add-vatprism 2024-07-28 12:15:11 +05:30
vc Merge pull request #329033 from Jayman2000/fix-317553 2024-07-28 21:44:55 +02:00
vd/vdhcoapp
ve
vg/vgm2x
vi
vk/vkd3d
vl
vm
vn
vo
vp
vs/vscode-js-debug
vu
vv/vvvvvv treewide: remove unused with statements from maintainer lists 2024-07-29 10:06:20 +08:00
vw/vwsfriend
vz/vzic
wa
wb
wc/wcurl
we
wf/wf-touch
wg/wg-access-server
wh
wi wiremock: 3.8.0 -> 3.9.1 2024-07-27 18:47:54 +00:00
wl
wo
wp
wr/wrangler
ws
wt
wv wvdial: init at unstable-2016-06-15 2024-07-27 19:11:02 +03:00
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 yazi-unwrapped: auto update version, build date & hash 2024-07-28 13:06:52 +01:00
yc/ycmd
yd/ydotool
ye
yg/yggdrasil
yj/yj
yo
ys/ysfx
yt
yu
za
zb/zbus-xmlgen
zc/zcfan
ze zed-editor: 0.144.4 -> 0.145.1 2024-07-28 14:05:10 +02:00
zf/zfind
zi
zl/zluda
zm/zmkBATx
zo
zp
zs
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;
}