nixpkgs/pkgs/by-name
Aleksana 590959643e
Merge pull request #305361 from Aleksanaa/gtklock
gtklock: 2.1.0 -> 3.0.0; gtk-session-lock: init at 0.2.0
2024-04-27 15:00:08 +08:00
..
_0/_0xpropo
_4 4d-minesweeper: fix package name 2024-04-25 13:52:41 +02:00
_6/_64gram
_9/_9base
a4/a4
a5/a52dec
aa
ab
ac
ad
ae
af
ag/ags
ai
al altdns: refactor 2024-04-26 09:41:41 +02:00
am
an anytype: 0.39.0 -> 0.40.2 2024-04-25 14:57:59 -04:00
ao/aocl-utils
ap
ar Merge pull request #306817 from DontEatOreo/update-arc-browser 2024-04-27 01:43:46 -04:00
as
at
au
av
aw
ax/axmldec
ay
ba
bc/bc-ur
be bee: 2.0.0 -> 2.0.1 2024-04-25 12:28:14 +00:00
bi
bk/bk
bl
bm/bmake
bn/bngblaster
bo
bp/bpftop
br
bs
bt
bu butt: set meta.platforms 2024-04-27 05:38:12 +02:00
by
c-
c2
ca
cb
cc
cd
ce
cg
ch
ci
cl
cm
cn/cntb
co Merge pull request #305642 from wegank/lib-version-fix 2024-04-26 10:55:51 +02:00
cp
cr
cs
ct/ctx
cu maintainers: drop danderson 2024-04-26 11:36:50 -07:00
cv/cvemap
cy
cz/czkawka
da
db/dbus-cpp
dc/dc3dd
dd
de
dg/dgoss
dh/dhcpig
di
dj/djent
dm
dn/dns2tcp
do
dp/dpp
dr/drone-scp
ds
dt
du
dv/dvb-apps
dx
dy
ea
eb
ec
ed
ei
ek/eksctl eksctl: 0.175.0 -> 0.176.0 2024-04-25 12:40:51 +00:00
el
em
en
ep/epub-thumbnailer
er
es
et
eu
ex
ez/eza eza: 0.18.11 -> 0.18.13 2024-04-25 17:49:09 +02:00
fa maintainers: remove federicoschonborn 2024-04-26 17:32:54 -03:00
fb/fbset
fc
fe
ff fflogs: init at 8.3.42 2024-04-25 23:33:33 +01:00
fg/fgqcanvas
fi
fl
fm fmtoy: 0.0.0-unstable-2023-05-21 -> 0-unstable-2024-04-18 2024-04-27 04:00:17 +02:00
fn/fnott
fo
fr frankenphp: 1.1.2 -> 1.1.4 2024-04-26 00:55:50 +00:00
fs
fu/fuchsia-cursor
fv
fw/fwupd
fy/fypp
fz/fzf-make
g3/g3kb-switch
ga garnet: 1.0.5 -> 1.0.6 2024-04-26 14:57:46 +00:00
gb/gbar
gc
ge
gf
gg/gg
gh
gi
gl
gm
gn
go go-camo: 2.4.12 -> 2.4.13 2024-04-26 11:11:11 +00:00
gp
gr Merge pull request #303035 from r-ryantm/auto-update/graphite-cli 2024-04-27 03:00:59 +02:00
gt Merge pull request #305361 from Aleksanaa/gtklock 2024-04-27 15:00:08 +08:00
gu
gv/gvisor
gx/gxml
h8/h8mail
ha
hb/hb-honeypot
hd/hdrop
he
hi
hj/hjson-go
ho
ht htb-toolkit: unstable-2024-01-17 -> 0-unstable-2024-04-22 2024-04-25 10:35:24 +02:00
hu hugo: 0.125.3 -> 0.125.4 2024-04-26 13:16:25 +02:00
hy
i2/i2p
i3
ia
ic
id
if/ifrextractor-rs
ig
ii
im
in
io/ioq3-scion
ip
ir
is/iscc
it
ja jan: 0.4.11 -> 0.4.12 2024-04-25 13:09:53 +00:00
jd/jdt-language-server
je
ji
jj/jj
jn
jo
jr/jrl-cmakemodules
js/jsoncons
ju
ka
kc
kd/kdsingleapplication
ke
kg/kgeotag
ki
kl/klog-time-tracker
km
kn/knossosnet
ko
kp/kplex
kr
ks
kt
ku
kx/kxstitch
ky/kyverno-chainsaw
la Merge pull request #289374 from D3vil0p3r/patch-4 2024-04-25 19:49:32 +10:00
lb
lc/lcab
ld/ldproxy
le Merge pull request #306702 from marsam/goodbye 2024-04-25 13:51:10 +02:00
li Merge pull request #306889 from r-ryantm/auto-update/livekit-cli 2024-04-26 09:44:48 -04:00
ll llama-cpp: 2700 -> 2746 2024-04-26 18:14:07 +00:00
lm/lmstudio
ln/lngen
lo
lp
ls
lt/ltris
lu
lw/lwgrp
lx
lz
m2
ma Merge pull request #305952 from drupol/mathemagix/init 2024-04-25 21:23:46 +02:00
mb
mc
md
me melonDS: 0.9.5-unstable-2024-01-17 -> 0.9.5-unstable-2024-04-18 2024-04-26 10:30:23 -03:00
mf
mg/mgitstatus
mi Merge pull request #306035 from Sigmanificient/calc-2.13.0 2024-04-27 02:33:26 -04:00
mk
ml/mlx42
mo Merge pull request #305721 from r-ryantm/auto-update/monophony 2024-04-27 04:34:25 +02:00
mp
mq
ms
mu
my
n2/n2
na
nb/nbtscan
nc
nd/ndstrim
ne Merge pull request #304948 from r-ryantm/auto-update/netclient 2024-04-27 03:39:50 +02:00
nf/nfft
ng
nh
ni Merge pull request #307044 from liclac/nix-web-v0.3.0 2024-04-26 21:42:41 +00:00
nl
nm/nmap-parse
nn/nncp
no
np
nr
ns
nt/ntfs2btrfs
nu
nv
nw
oa
ob
oc
oe/oelint-adv
of
oh/oh-my-fish
oi
ol/olvid
om omnictl: 0.33.2 -> 0.34.0 2024-04-26 11:12:58 +00:00
on
op Merge pull request #306277 from adamcstephens/ovs/fix-python313 2024-04-26 16:29:51 -04:00
or
os
ot oterm: 0.2.6 -> 0.2.7 2024-04-25 20:19:59 +00:00
ou
ov
ow
pa maintainers: remove patka 2024-04-26 21:52:53 +02:00
pd
pe Merge pull request #306940 from avdv/bazel_6.5.0-aftermath 2024-04-26 22:49:45 -04:00
pf/pfft
pg
ph maintainers: remove patka 2024-04-26 21:52:53 +02:00
pi
pk
pl
pm
pn
po Merge pull request #305642 from wegank/lib-version-fix 2024-04-26 10:55:51 +02:00
pp/ppsspp
pq
pr protoc-gen-js: Update hash after bazel_6 upgrade 2024-04-26 20:57:54 +02:00
pt
pu
pv/pvsneslib
pw
px/pxder
py pyprland: 2.2.10 -> 2.2.12 2024-04-25 21:02:58 +00:00
pz/pzip
qa/qadwaitadecorations
qc/qcm
qd/qdirstat
qg/qgrep
qp/qpoases
qr
qs
qt/qtractor
qu
r1/r10k
ra
rc
rd/rdwatool
re regal: 0.21.0 -> 0.21.2 2024-04-26 02:38:08 +00:00
ri ripsecrets: 0.1.7 -> 0.1.8 2024-04-26 11:22:18 +00:00
rk
rl/rl_json
rm
rn/rnd-name
ro
rp/rpcs3
rq/rqbit
rs
rt/rtg-tools
ru
rw/rwpspread
ry
s3
sa
sb/sbom-utility
sc
sd
se
sg/sgfutils
sh
si
sk Merge pull request #277052 from YvesStraten/init-skimpdf 2024-04-27 01:32:20 -04:00
sl
sm
sn Merge pull request #305642 from wegank/lib-version-fix 2024-04-26 10:55:51 +02:00
so soupault: 4.9.0 → 4.10.0 2024-04-26 15:26:55 +02:00
sp
sq
sr
ss
st Merge pull request #305717 from r-ryantm/auto-update/strictdoc 2024-04-27 04:33:46 +02:00
su
sv
sw Merge pull request #305642 from wegank/lib-version-fix 2024-04-26 10:55:51 +02:00
sx
sy
t-/t-rex
ta Merge pull request #305567 from r-ryantm/auto-update/tailscale-nginx-auth 2024-04-27 04:43:15 +02:00
tc/tcsh
td/tdl
te Merge pull request #306794 from r-ryantm/auto-update/tenv 2024-04-26 16:16:08 +08:00
tg/tgpt
th
ti Merge pull request #305642 from wegank/lib-version-fix 2024-04-26 10:55:51 +02:00
tk
tl
tm/tmuxifier
to
tp
tr
tt/ttop
tu
tw/twitch-dl
tx/txr
ty
uc
ud
ue
ug
ui
um/umpire
un unciv: 4.11.4 -> 4.11.8 2024-04-25 18:02:02 +00:00
up
us/usql
ut
uu/uuu
uv/uv
uw/uwhoisd
ux/uxn
va
vc
ve
vg/vgm2x
vi
vl
vo/voidmap
vu
vv/vvvvvv
wa Merge pull request #307054 from FedericoSchonborn/maintainers-remove-federicoschonborn 2024-04-27 02:07:25 +02:00
wb/wb32-dfu-updater
we
wh Merge pull request #306502 from r-ryantm/auto-update/whatsapp-emoji-font 2024-04-25 09:46:55 -04:00
wi
wl Merge pull request #304585 from name-snrl/update-wl-clip-persist 2024-04-25 22:28:11 +02:00
wo
wp/wp-cli
ws
wt
wy/wyoming-satellite
x1/x16
x5/x509-limbo
xa/xarcan
xc
xd
xe
xf/xfs-undelete
xi
xm
xo
xp/xplr
xr/xr-hardware
xs
xw/xwayland-run
ya Merge pull request #306385 from khaneliman/yabai 2024-04-27 01:38:00 +02:00
yc/ycmd
ye
yg/yggdrasil
yj/yj
yo
ys/ysfx
yt
yu
za
zb/zbus-xmlgen
zc/zcfan
ze
zi
zl/zluda
zo/zola
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;
}