1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs synced 2024-10-19 03:47:13 -04:00
nixpkgs/pkgs/by-name
2024-04-03 22:45:06 -05:00
..
_4/_4th
_6/_64gram _64gram: fix uppercase letter in pname 2024-04-03 23:51:35 +08:00
_9/_9base
a4/a4
a5/a52dec
aa
ab/aba
ac
ad
ae
af
ag/ags
ai
al
am
an
ao/aocl-utils
ap
ar
as
at athens: 0.13.1 -> 0.13.2 2024-04-02 14:50:47 +02:00
au
av
aw
ax/axmldec
ay
ba
bc/bc-ur
be
bi
bk/bk
bl
bm/bmake
bn/bngblaster
bo
bp/bpftop
br
bs/bsync
bt/bt-migrate
bu
by
c-
c2
ca cargo-pgo: 0.2.6 -> 0.2.8 2024-04-03 00:19:30 +00:00
cb
cc/ccache
cd
ce
cg
ch
ci
cl
cm
cn/cntb
co Merge pull request #300649 from RAVENz46/master 2024-04-02 21:09:14 +08:00
cp
cr
cs
ct/ctx
cu
cv/cvemap
cy
cz/czkawka
da Merge pull request #301274 from Ramblurr/update/davis 2024-04-03 18:29:26 -03:00
db/dbus-cpp
dc/dc3dd
dd
de
dg/dgoss
di
dj/djent
dm
dn/dns2tcp
do
dp/dpp
dr/drone-scp
ds
dt/dtcmp
du
dv/dvb-apps
dx
dy
ea/easyeasm
eb
ec
ed
ei
ek/eksctl
el
em
en
ep/epub-thumbnailer epub-thumbnailer: 0-unstable-2024-03-16 -> 0-unstable-2024-03-26 2024-04-03 13:31:55 +02:00
er
es
et
eu
ex
ez/eza
fa
fb/fbset
fc
fe
ff
fi
fl Merge pull request #299177 from Rucadi/flatito 2024-04-03 08:38:17 +02:00
fm
fn/fnott
fo
fr
fs
fu/fuchsia-cursor
fv
fw/fwupd
fy/fypp
g3/g3kb-switch
ga
gb/gbar
gc
ge
gg/gg
gh Merge pull request #301263 from loicreynier/gh-f-make-standalone 2024-04-03 23:46:03 +08:00
gi
gl
gm
gn
go
gp
gr
gt
gu
gx/gxml
h8/h8mail
ha
hd/hdrop
he
hi
hj/hjson-go
ho
ht
hu/hugo
hy
i3
ia
ic
id
if/ifrextractor-rs
ig
ii
im
in incus.ui: 0.6 -> 0.7 2024-04-03 20:46:12 +02:00
io/ioq3-scion
ip
ir/ironbar
it
ja jan: 0.4.9 -> 0.4.10 2024-04-02 13:04:25 +00:00
jd/jdt-language-server
je jetbrains-toolbox: move to pkgs/by-name 2024-04-02 21:15:08 +02:00
ji
jj/jj
jn
jo
js/jsoncons
ju
ka
kc
kd/kdsingleapplication
ke
kg/kgeotag
ki
kl/klog-time-tracker
km
kn/knossosnet
ko
kp/kplex
kr
ks kshutdown: init at 5.91-beta 2024-04-02 11:39:56 -07:00
kt
ku
kx/kxstitch
ky/kyverno-chainsaw
la
lb
lc/lcab
le
li Merge pull request #300271 from devhell/bump-mediainfo 2024-04-04 04:29:18 +08:00
ll
lm/lmstudio
ln/lngen
lo
lp
ls
lt/ltris
lu
lw/lwgrp
lx lxd: rename to lxd-lts 2024-04-02 19:35:44 -04:00
lz
m2
ma Merge pull request #300501 from fabaff/malwoverview 2024-04-03 22:27:12 +02:00
mb/mbpoll
mc
md
me Merge pull request #300271 from devhell/bump-mediainfo 2024-04-04 04:29:18 +08:00
mf
mg/mgitstatus
mi minijinja: 1.0.15 -> 1.0.16 2024-04-03 04:15:54 +00:00
mk
ml/mlx42
mo
mp/mpifileutils
mq
ms
mu
my mystmd: 1.1.48 -> 1.1.50 2024-04-03 08:49:58 +00:00
n2/n2
na
nb/nbtscan
nc
nd/ndstrim
ne
nf/nfft
nh
ni
nl
nm/nmap-parse
nn/nncp
no
np
nr
ns
nt/ntfs2btrfs
nu
nv
nw
oa
ob
oc nixos/ocis: init at 5.0.0 2024-04-03 00:53:24 +05:30
oe/oelint-adv
of
oh/oh-my-fish
oi
ol/olvid
om/omniorbpy
on
op
or
os
ot oterm: 0.2.4 -> 0.2.5 2024-04-02 19:41:32 +00:00
ou
ov
ow
pa
pd
pe
pf/pfft
pg
ph phpactor: change maintainer & move to by-name 2024-04-03 20:01:34 +02:00
pi
pk/pkcrack
pl Merge pull request #298556 from kachick/init-plemoljp-font 2024-04-04 08:37:15 +11:00
pm
pn
po
pp/ppsspp
pq
pr prowler: relax azure-storage-blob 2024-04-03 20:22:01 +02:00
pt
pu
pv/pvsneslib
pw
px/pxder
py
pz/pzip
qa/qadwaitadecorations
qc/qcm
qd/qdirstat
qg/qgrep
qr
qs
qt/qtractor
qu
ra
rc
rd/rdwatool
re
ri
rk/rkbin
rl/rl_json
rm rmenu: init at 1.2.0 2024-04-03 18:09:53 +02:00
ro
rp/rpcs3
rq/rqbit
rs
rt rtg-tools: init at 3.12.1 2024-04-02 23:20:30 +02:00
ru
rw/rwpspread rwpspread: 0.2.4 -> 0.2.5 2024-04-03 11:15:01 +00:00
ry/ryujinx
s3
sa
sc
sd
se
sg/sgfutils
sh shopware-cli: 0.4.30 -> 0.4.33 2024-04-03 06:02:20 +00:00
si Merge pull request #298616 from sikmir/simplotask 2024-04-04 00:22:05 +04:00
sl
sm
sn
so
sp
sq
sr
ss
st Merge pull request #283305 from TomaSajt/stirling-pdf 2024-04-03 07:39:17 +02:00
su
sv
sw
sx
sy
t-/t-rex
ta Merge pull request #301038 from r-ryantm/auto-update/tailscale-nginx-auth 2024-04-03 10:04:59 -04:00
tc/tcsh
td/tdl
te
tg/tgpt
th
ti
tk/tkdiff
tl
tm/tmuxifier
to
tp
tr
tt/ttop
tu
tx/txr
ty
uc
ud
ue
ug/ugrep-indexer
ui
um/umpire
un
up
us/usql
ut
uu/uuu
uv/uv
uw/uwhoisd
ux/uxn
va
vc
ve
vg/vgm2x
vi
vl
vu
wa
wb/wb32-dfu-updater
we
wh
wi Merge pull request #300909 from fabaff/witnessme 2024-04-03 23:25:03 +02:00
wl
wo
wp/wp-cli
ws
wt/wtfis
wy/wyoming-satellite
x1/x16
x5/x509-limbo
xa/xarcan
xc
xd
xe
xf/xfs-undelete
xi xiu: 0.12.5 -> 0.12.6 2024-04-04 01:59:13 +00:00
xm
xo
xp/xplr
xr/xr-hardware
xs
xw/xwayland-run
ya
yc/ycmd
ye
yg/yggdrasil
yj/yj
yo
ys/ysfx
yt
yu
za
zb/zbus-xmlgen
zc/zcfan
ze/zesarux
zi
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;
}