Commit Graph

155 Commits

Author SHA1 Message Date
Robert Hensing
8d128a4138 testers.testEqualContents: add postFailureMessage parameter
Add an optional postFailureMessage parameter to testEqualContents that allows
users to provide additional context when tests fail. This is particularly useful
for providing instructions on how to update expected results when they change
intentionally.

The message is displayed after the standard failure output, helping maintainers
understand what to do next when a test fails.
2025-08-24 20:09:54 +02:00
Defelo
0f4642c796 fetchFromRadicle: init 2025-08-20 15:29:26 +02:00
Johannes Kirschbauer
324edb5654 nixpkgs-manual: doc/build-helpers: fix broken links to derivation's advanced attributes (#427734) 2025-08-18 15:08:24 +02:00
Alan Urmancheev
618155ad67 doc/build-helpers: fix broken links to derivation's advanced attributes 2025-08-17 01:12:24 +04:00
Philip Taron
754ee2fc40 fetchgit: Add rootDir argument (#427165) 2025-08-10 17:38:43 -07:00
Yuriy Taraday
34612851db fetchgit: Add rootDir argument
With this argument fetchgit will make a subdirectory of the Git
repository a root of the resulting store path. This is helpful for
dealing with monorepos where many projects are in separate directories
and don't need a new source hash every time the monorepo is updated.

Commit hash is removed from the name of the derivation to prevent it
from changing the store path when nothing in the subdirectory changes.
2025-08-08 16:20:05 +02:00
Philip Taron
0ca32f3372 tor: add tor.proxyHook (#426763) 2025-07-25 15:16:39 -07:00
Ryan Hendrickson
a3947d986f tor: add tor.proxyHook
tor.proxyHook is a setup hook intended for use with HTTP-based fetchers,
enabling them to download from .onion addresses using Tor as a proxy.
2025-07-24 13:25:04 -04:00
Wolfgang Walther
62fe016519 treewide: run treefmt with mdcr/nixfmt 2025-07-24 13:52:31 +02:00
Philip Taron
8279ffe622 treewide: specify that mebibytes are used when it's ambiguous (#424169) 2025-07-11 12:29:33 -07:00
Axel Karjalainen
7159ab6f43 treewide: specify where mebibytes are used when it's ambiguous 2025-07-11 00:44:23 +03:00
Yueh-Shun Li
ef2f8315bf fetchhg: make argument hash overridable 2025-07-09 04:08:00 +08:00
Nick Cao
abe0e73a27 testers.hasCmakeConfigModules: init (#410516) 2025-06-03 20:40:35 -04:00
qbisi
11291afcb3 testers.hasCmakeConfigModules: init 2025-05-31 04:24:52 +08:00
Tim Black
1247031689 pkgs/build-support/fetchgit: add fetchTags parameter
Added fetchTags feature to fetchgit, explicit and clear support for
fetching all tags after the source tree fetch completes. Doing this at
build-time in the fetcher is required for packages that invoke commands
like 'git describe' which require tags, and since the nix store is
read-only by design, it is not possible to git fetch --tags at
activation- or run-time. This feature may have been possible by
specifying a postFetch option including calling git fetch --tags,
however doing so obfuscates the solution to this very real problem.
Explicit support for fetching tags should be a first class citizen just
like fetching other refs.
2025-05-28 16:47:34 -07:00
Niklas Hambüchen
45991097c5 manual: Use a postPatch instead of a patchPhase 2025-05-24 22:10:55 +00:00
Niklas Hambüchen
ee6c2bd2eb doc: Fix missing pre/post hooks everywhere 2025-05-24 13:22:41 +00:00
Adam Dinwoodie
d95d3724d8 fetchgit: add preFetch hook
This allows running code to change the environment before the
nix-prefetch-git script is run.  In particular, it allows setting things
like NIX_PREFETCH_GIT_CHECKOUT_HOOK, which allows additional code to be
run before deleting the .git directory.

This also means there's potentially value in performing a deep clone
then removing the .git directory, so remove the assertion that prevents
doing so.
2025-05-06 14:14:26 +01:00
Pol Dellaiera
3218a4204f doc: do not reuse pname 2025-04-21 07:02:49 +02:00
Pol Dellaiera
bcea0cf344 doc: update Nix code snippets format
Command: `mdcr --config doc/tests/mdcr-config.toml doc/`
2025-04-17 01:30:34 +02:00
Pol Dellaiera
5d979e79ce doc: fix various nix snippets 2025-04-17 01:30:34 +02:00
Connor Baker
871cda0b06 testers.shellcheck: refactor, update docs, and simplify tests (#385940) 2025-03-07 20:53:33 -08:00
Connor Baker
3de1aeac1f testers.shellcheck: refactor and update docs 2025-03-08 00:15:22 +00:00
Philip Taron
cb26667f94 testers.shfmt: init (#385939) 2025-03-07 15:45:30 -08:00
Connor Baker
6f52f21ad2 testers.shfmt: init 2025-03-05 12:40:58 -08:00
Connor Baker
731b74db8b testers.testEqualArrayOrMap: use buildCommandPath and change checkSetupScript argument to script 2025-03-03 16:29:40 +00:00
Connor Baker
261693fe5d testers.testEqualArrayOrMap: init 2025-03-03 16:29:11 +00:00
Connor Baker
f71332b2ae testers.testBuildFailure': output is created so long as checks succeed 2025-02-27 15:56:45 +00:00
Connor Baker
38745b132d testers.testBuildFailure': init 2025-02-27 15:56:45 +00:00
Philip Taron
6ea4ff601e mkBinaryCache: support zstd and none as compression methods (#376365) 2025-02-26 09:05:25 -08:00
Peder Bergebakken Sundt
d525eb5838 treewide: fix typos
done with `fd \\\.md$ . --type f -x typos --write-changes`
2025-02-22 02:02:07 +01:00
thomasjm
00a218abb2 mkBinaryCache: support different compression methods: xz (default), zstd, none 2025-02-04 05:49:39 -08:00
Seth Flynn
d73ab2f142 doc: emphasize trade-off between versionCheckHook and testers.testVersion (#344321) 2025-01-27 00:44:44 -05:00
Peder Bergebakken Sundt
4762d9ba6e doc: emphasize trade-off between versionCheckHook and testers.testVersion 2025-01-26 17:11:00 +01:00
Yueh-Shun Li
bbdf8601bc doc: add chapter Fixed-point arguments of build helpers
Add "Fixed-point arguments of build helpers" chapter in "Builde helpers" part.

Co-authored-by: nicoo <nicoo@mur.at>
Co-authored-by: Silvan Mosberger <github@infinisil.com>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Lin Jian <me@linj.tech>
Co-authored-by: Philip Taron <philip.taron@gmail.com>
2025-01-19 01:00:50 +08:00
Matt Sturgeon
e4469b7af2 buildFHSEnv: allow specifying executableName explicitly 2025-01-08 18:33:28 +00:00
Patrick
7e504761f0 doc: fix fetchDebianPatch example 2024-12-30 12:18:47 +01:00
Jörg Thalheim
ff8576f191 dockerTools.pullImage: accept hash parameter (#342400) 2024-12-09 15:32:15 +01:00
nicoo
5720f42c32 nix-prefetch-docker: provide hash in SRI format 2024-12-09 14:28:25 +01:00
nicoo
d0e6b0e170 dockerTools.pullImage: accept hash parameter 2024-12-09 14:28:24 +01:00
Philip Taron
7822cb34f8 fetchgit{,hub}: add tag argument (#355973) 2024-12-05 07:40:05 -08:00
Gavin John
67a56f27f2 doc/build-helpers/testers: Fix command renamed to script (#352713) 2024-12-04 22:53:21 +00:00
Wolfgang Walther
51da8b6b00 writeReferencesToFile: remove
Had been deprecated and scheduled for removal in 24.11.
2024-11-22 21:01:53 +01:00
Atemu
cb9f9a1e5a fetchgit{,hub}: add tag argument
It's become a common pattern to use `rev = "refs/tags/${version}"` rather than
just `rev = version` to ensure that the tag gets fetched rather than a branch
that has the same name. This has so far been done using boilerplate though, so
let's add a simple abstraction to fetch a tag instead.
2024-11-18 08:20:00 +01:00
Atemu
1712d71ea7 doc: document commonly used fetchgit flags
Some important ones like fetchLFS were missing. See
https://discourse.nixos.org/t/how-to-use-git-lfs-with-fetchgit/55975 for a
documented instance where this confused a user.

This still isn't complete but the remaining ones I felt were rather niche and I
am not familiar enough with them to sufficiently document their purpose or
usage.
2024-11-14 23:49:57 +01:00
Daniel Baker
052431ce98 doc: replace references to --replace for the substitute command
The `--replace` argument for `substitute` and `substituteInPlace` was
deprecated in e07a2fab7f. Updating all
references in the nixpkgs manual to use `--replace-fail`.
2024-11-06 14:08:28 -08:00
Matthias Beyer
c04462bf2d doc: Add missing debian12 attribute names (#339780) 2024-10-25 07:55:17 +02:00
Peder Bergebakken Sundt
6fd3990534 trivial: make symlinkJoin support pname+version alone 2024-09-28 01:35:47 +02:00
Tom Bereknyei
d0b3364822 dockerTools: set mtime to epoch by default 2024-09-25 00:31:16 -04:00
WxNzEMof
847b4732e4 dockerTools: Allow separately specifying metadata and filesystem timestamps
Setting the image creation timestamp in the image metadata to a
constant date can cause problems with self-hosted container
registries, that need to e.g. prune old images.  This timestamp is
also useful for debugging.

However, it is almost never useful to set the filesystem timestamp to
a constant value.  Doing so not only causes the image to possibly no
longer be reproducible, but also removes any possibility of
deduplicating layers with other images, causing unnecessary storage
space usage.

Therefore, this commit introduces "mtime", a new parameter to
streamLayeredImage, which allows specifying the filesystem timestamps
separately from "created".  For backwards compatibility, "mtime"
defaults to the value of "created".
2024-09-25 00:23:20 -04:00