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-03-11 13:11:11 +01:00
..
_4/_4th
_9/_9base
a4/a4
aa
ab/aba
ac
ad
ae
af
ag/ags
ai
al
am
an
ao/aocl-utils
ap
ar
as
at
au audiness: 0.3.0 -> 0.3.1 2024-03-09 20:43:19 +00:00
av
aw
ax/axmldec
ay
ba
bc/bc-ur
be
bi
bk/bk
bl
bm/bmake
bn/bngblaster
bo bochs: 2.7 -> 2.8 2024-03-10 12:24:08 +00:00
bp/bpftop
br
bs/bsync
bu
by
c-
c2
ca
cb/cbmbasic
cc/ccache
cd
ce
cg/cgl
ch
ci
cl clash-nyanpasu: init at 1.4.5 2024-03-10 20:30:52 +01:00
cm
cn/cntb
co
cp
cr
cs
ct/ctx
cu/cursewords
cy
cz/czkawka
da
db/dbus-cpp
dc/dc3dd
dd
de dep-scan: 5.0.2 -> 5.2.11 2024-03-10 10:39:14 -05:00
di
dj/djent
dm dmarc-report-converter: 0.6.5 -> 0.7.0 2024-03-09 12:30:12 +00:00
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
er
es
et/etlegacy etlegacy: 2.81.1 -> 2.82.0 2024-03-10 10:29:52 +01:00
eu
ex
ez/eza
fa
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.40 -> 2.12.41 2024-03-10 23:20:03 +00:00
fl flatter: 0-unstable-2023-08-10 -> 0-unstable-2024-03-04 2024-03-09 21:34:54 +01:00
fm
fn/fnott
fo folio: init at 24.05 2024-03-11 03:35:20 +08:00
fr Merge pull request #277814 from eliandoran/dev/frequest 2024-03-11 11:39:35 +02:00
fu/fuchsia-cursor
fw/fwupd
fy/fypp
ga Merge pull request #292325 from motiejus/gamja 2024-03-10 08:57:35 -04:00
gb/gbar
gc
ge
gh
gi Merge pull request #293046 from kuznetsss/Add_git-agecrypt 2024-03-11 11:46:23 +01:00
gl
gm Merge pull request #294558 from Aleksanaa/gmetronome 2024-03-10 20:44:03 +01:00
gn/gnucap
go Merge pull request #133542 from fpletz/refactor/pinentry-remove-multiple-outputs 2024-03-09 23:57:27 +01:00
gp
gr
gt
gu
gx/gxml
h8/h8mail
ha
hd/hdrop
he
hi/hifile
hj/hjson-go
ho
ht
hu/hugo hugo: 0.123.7 -> 0.123.8 2024-03-10 07:04:38 +00:00
hy
i3
ia
ic
id/idsk
if/ifrextractor-rs
ig
ii
im
in Merge pull request #294263 from r-ryantm/auto-update/invidtui 2024-03-10 23:58:25 +01:00
io/ioq3-scion
ip/ipam
ir/ironbar
it/itch
ja jan: 0.4.7 -> 0.4.8 2024-03-11 09:44:17 +01:00
jd/jdt-language-server
ji
jj/jj
jn/jnr-posix
jo
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
kg/kgeotag
ki
kl/klog-time-tracker
km/kmsvnc
kn/knossosnet
ko
kp/kplex
kr/krr
ks/kseexpr
kt
ku
kx/kxstitch
la
lb
lc/lcab
le
li Merge pull request #293031 from Aleksanaa/librum 2024-03-10 22:13:30 +04:00
ll llama-cpp: 2346 -> 2382 2024-03-10 12:09:01 +00:00
ln/lngen
lo
lp/lpairs2
ls
lt/ltris
lu Merge pull request #278108 from eliandoran/dev/lunacy 2024-03-09 15:27:19 -08:00
lw/lwgrp
lz
m2
ma
mc
md
me Merge pull request #294506 from r-ryantm/auto-update/mev-boost 2024-03-09 19:06:22 -05:00
mf
mg/mgitstatus
mi clash-meta: rename to mihomo (#271658) 2024-03-10 19:46:10 +01:00
mk
ml/mlx42
mo movim: missing extensions, allow passing PHP cfg 2024-03-09 20:59:31 +07:00
mp/mpifileutils
mq
ms
mu
my mystmd: 1.1.45 -> 1.1.46 2024-03-10 04:45:10 +00:00
n2/n2
na
nb/nbtscan
nc
ne netease-cloud-music-gtk: 2.3.0 -> 2.3.1 2024-03-10 20:19:52 +08:00
nf/nfft
nh nh: 3.5.3 -> 3.5.4 2024-03-10 16:02:28 +01:00
ni niri: add foo-dogsquared as maintainer 2024-03-09 22:38:19 +08:00
nl
nm/nmap-parse
nn/nncp
no
np
nr
ns
nu numbat: 1.10.1 -> 1.11.0 2024-03-10 01:22:50 +00:00
nv
nw
oa
ob
oc
oe/oelint-adv
of/offpunk
oh/oh-my-fish
oi
on
op openscad-unstable: run tests 2024-03-11 13:25:43 +08:00
or
os
ot
ou
ov
ow/owncloud-client
pa
pd
pe
pf/pfft
pg
ph
pi
pk/pkcrack
pl
pm
pn/pnfft
po
pp/ppsspp
pq
pr
pt
pu
pw
px/pxder
py pyprland: 2.0.5 -> 2.0.8 2024-03-09 17:56:42 +00:00
pz/pzip
qa/qadwaitadecorations
qc/qcm
qg/qgrep
qr
qs
qt/qtractor
qu
ra
rc
re Merge pull request #285865 from sikmir/reproxy 2024-03-11 11:47:33 +01:00
ri
rl/rl_json
rm/rmg
ro
rp/rpcs3
rq/rqbit
rs
rt/rtl-sdr-osmocom
ru
rw/rwpspread
ry/ryujinx
s3
sa
sc
sd
se Merge pull request #294071 from amalgame21/searxng-fix 2024-03-10 23:54:25 +01:00
sg/sgfutils
sh
si
sl
sm
sn
so sophus: init at 1.22.10 2024-03-10 13:23:16 -03:00
sp
sq
sr
ss sshd-openpgp-auth: init at 0.3.0 2024-03-10 20:49:28 +02:00
st
su
sv
sw
sx
sy
ta
tc/tcsh
td/tdl
te
tg/tgpt
th
ti tippecanoe: 2.49.0 -> 2.51.0 2024-03-10 22:10:13 +00:00
tk/tkdiff
tl
tm/tmuxifier
to
tp
tr
tt/ttop
tu
tx/txr
ty typst: 0.10.0 -> 0.11.0-rc1 2024-03-10 13:46:07 +01:00
uc
ud
ue
ui
um/umpire
un
up
us/usql
ut
uu/uuu
uv/uv uv: 0.1.16 -> 0.1.17 2024-03-10 04:20:00 +00:00
ux/uxn uxn: 1.0-unstable-2024-02-15 -> 1.0-unstable-2024-03-08 2024-03-09 21:18:33 +01:00
va
vc
ve
vg/vgm2x
vi
vl
vu/vulkan-volk
wa
wb/wb32-dfu-updater
we
wh whistle: 2.9.65 -> 2.9.66 2024-03-11 01:11:00 +00:00
wi
wl
wo
wp/wp-cli
ws
wt/wtfis
x1/x16
xa/xarcan
xc
xd xdg-desktop-portal-shana: 0.3.9 -> 0.3.11 2024-03-10 12:29:35 +00:00
xf/xfs-undelete
xi
xm
xo
xp/xplr
xr/xr-hardware
xs
xw/xwayland-run
ya yazi-unwrapped: 0.2.3 -> 0.2.4 2024-03-10 16:07:21 +01:00
ye
yg/yggdrasil
yj/yj
yo
ys/ysfx
yt ytdownloader: add patch to set correct config dir 2024-03-09 15:06:15 +00:00
yu/yunfaavatar
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

$ ./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;