Commit Graph

14128 Commits

Author SHA1 Message Date
Valentin Gagarin
362256cb58
show Nix logo in the manual (#10442)
the location of files is hard-coded by mdBook.
there is also seems to be no way to define custom templates, therefore
all styling has to be done in the CSS override.

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2024-04-09 09:10:17 +00:00
Théophane Hufschmitt
b59275b441
Merge pull request #10390 from fricklerhandwerk/src-test
backport `src` definition from 2.16
2024-04-03 13:46:15 +02:00
Valentin Gagarin
86a6628c58 backport src definition from 2.16
This fixes a weirdness when consuming `default.nix` from the 2.15 release branch archive,
where the Nix derivation's `src` store path gets wrapped for some reason:

    "src": "/nix/store/mfa0j89j4f42nrxwxfwqrz0b6m32ih99-fcyq2x0wld440n9jc756vnh93kvjz9ac-source",

This is the only difference to instantiating the Nix derivation from the
repository itself, and prevents a build cache hit.

It doesn't happen on 2.14 (adds `flake-compat`) and 2.16 (uses `cleanSource`).
I suppose this is somehow caused by `flake-compat` doing something funky,
2024-04-03 13:28:32 +02:00
Théophane Hufschmitt
3d21bb8464
Merge pull request #10186 from NixOS/backport-10183-to-2.15-maintenance
[Backport 2.15-maintenance] 2.16 faster flake lock parsing
2024-03-08 10:28:54 +01:00
Graham Dennis
024cf4aa66 Faster flake.lock parsing
This PR reduces the creation of short-lived basic_json objects while
parsing flake.lock files. For large flake.lock files (~1.5MB) I was
observing ~60s being spent for trivial nix build operations while
after this change it is now taking ~1.6s.

(cherry picked from commit 7fd0de38c6)
(cherry picked from commit f94fb636c0)
2024-03-07 23:06:46 +00:00
github-actions[bot]
967e13adfc
fix location of _redirects file (#9953) 2024-02-07 11:44:29 +01:00
github-actions[bot]
6f2f4917b8
fix an old lost direct (#9714)
this part must have been moved quite a while ago, but apparently so far
no one noticed

(cherry picked from commit 6db805b3d1)

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2024-01-08 20:57:12 +01:00
Robert Hensing
e64e428ef6
Merge pull request #9468 from NixOS/backport-9459-to-2.15-maintenance
[Backport 2.15-maintenance] add path based redirects
2023-11-27 15:15:36 +01:00
Valentin Gagarin
9f9d46f9a0 add path based redirects
up to now, those were managed outside of this repo, which as
unsurprisingly a real hassle to deal with if one wanted to prevent URLs
from breaking when moving pages around. this change removes a large part
of the friction involved in moving content in the Nix manual.

possible next steps for further automation:
- check for content that moved and warn if it's not reachable from
  links that were valid prior to a change
- create redirect rules automatically based on this information

(cherry picked from commit 2b7016cc56)
2023-11-27 13:28:49 +00:00
John Ericson
c6c5123f42
Merge pull request #9433 from NixOS/backport-9431-to-2.15-maintenance
[Backport 2.15-maintenance] Add missing `-lrapidcheck` fixing build with shared lib
2023-11-22 09:46:30 -05:00
John Ericson
cba5644c4e Add missing -lrapidcheck fixing build with shared lib
https://github.com/NixOS/nixpkgs/pull/269064 makes rapidcheck be build
as a shared lib, but that broke Nix because the `-lrapidcheck` was
missing. This fixes that (and doesn't break Nix what the library is a
static archive as today).

(cherry picked from commit 46131567da)
2023-11-22 04:48:01 +00:00
Théophane Hufschmitt
403902d84a
Merge pull request #9403 from NixOS/backport-9390-to-2.15-maintenance
[Backport 2.15-maintenance] fetchTree: clarify docs for shallow flag
2023-11-20 15:38:13 +01:00
DavHau
1878afdd6a fetchTree: clarify docs for shallow flag
(cherry picked from commit 796a7eb92d)
2023-11-20 14:15:50 +00:00
Robert Hensing
c223618a24
Merge pull request #9130 from hercules-ci/backport-9095-to-2.15-maintenance
[Backport 2.15-maintenance] StorePath: reject names starting with '.', Fix typo in error message of too long store path
2023-10-23 19:32:24 +02:00
edef
a06801de17 StorePath: reject names starting with '.'
This has been the behaviour before Nix 2.4. It was dropped in a rewrite
in 759947bf72, allowing the creation of
store paths that aren't considered valid by older Nix versions or other
Nix tooling.

Nix 2.4 didn't ship in NixOS until 22.05, and stdenv.mkDerivation in
nixpkgs drops leading periods since April 2022, so it's unlikely anyone
is relying on the current lax behaviour.

Closes #9091.

Change-Id: I4a57bd9899e1b0dba56870ae5a1b680918a18ce9
2023-10-23 18:41:09 +02:00
oxalica
8f74170e5e Fix typo in error message of too long store path
(cherry picked from commit 303858afad)
2023-10-23 18:41:09 +02:00
Robert Hensing
765d19be6a
Merge pull request #9214 from NixOS/backport-9211-to-2.15-maintenance
[Backport 2.15-maintenance] ci: bump install-nix-action, don't fail fast
2023-10-23 18:40:53 +02:00
Naïm Favier
cfc45b59de ci: bump install-nix-action, don't fail fast
(cherry picked from commit b931d83550)
(cherry picked from commit ade3bffad3)
2023-10-23 17:27:19 +02:00
Eelco Dolstra
ec8ec95009 Bump version 2023-10-19 21:34:57 +02:00
Eelco Dolstra
83a035aafe Fix C++17 build
(cherry picked from commit 2cf2bb45fc)
2023-10-19 18:58:00 +02:00
Eelco Dolstra
170f834fa2 Tarball trees: Propagate lastModified
This makes them behave consistently with GitHub/GitLab flakes.

(cherry picked from commit 81045f243f)
(cherry picked from commit eb21904198)
2023-10-19 18:57:52 +02:00
Eelco Dolstra
f9064a4ae4 Document that redirected tarball flakerefs can specify lastModified
(cherry picked from commit 56763ff918)
(cherry picked from commit 70559cf89a)
2023-10-19 18:55:36 +02:00
Eelco Dolstra
c3bbedaed5 Bump version 2023-08-14 11:49:23 +02:00
Eelco Dolstra
f068be4cbc Add docs
(cherry picked from commit cab03fb779)
2023-08-11 17:26:58 +02:00
Eelco Dolstra
543c06322c Allow tarball URLs to redirect to a lockable immutable URL
Previously, for tarball flakes, we recorded the original URL of the
tarball flake, rather than the URL to which it ultimately
redirects. Thus, a flake URL like
http://example.org/patchelf-latest.tar that redirects to
http://example.org/patchelf-<revision>.tar was not really usable. We
couldn't record the redirected URL, because sites like GitHub redirect
to CDN URLs that we can't rely on to be stable.

So now we use the redirected URL only if the server returns the
`x-nix-is-immutable` or `x-amz-meta-nix-is-immutable` headers in its
response.

(cherry picked from commit 1ad3328c5e)
(cherry picked from commit dc718e28c9)
2023-08-11 17:26:38 +02:00
Eelco Dolstra
375bd8012a Add a generic check for rev attribute mismatches
(cherry picked from commit 3402b650cd)
2023-08-10 18:51:46 +02:00
Robert Hensing
f39df9bac9 Fixup release notes (#8393)
* Fixup release notes

(cherry picked from commit 995b658e72)
2023-08-10 18:51:20 +02:00
Robert Hensing
e597572fa6 rl-next.md: Minor improvement
(cherry picked from commit 37c533ed27)
2023-08-10 18:51:11 +02:00
Alex Ameen
62a43a742d primop: add readFileType, optimize readDir
Allows checking directory entry type of a single file/directory.

This was added to optimize the use of `builtins.readDir` on some
filesystems and operating systems which cannot detect this information
using POSIX's `readdir`.

Previously `builtins.readDir` would eagerly use system calls to lookup
these filetypes using other interfaces; this change makes these
operations lazy in the attribute values for each file with application
of `builtins.readFileType`.

(cherry picked from commit 153ee460c5)
2023-08-10 18:51:05 +02:00
Eelco Dolstra
374bc3ec8d
Merge pull request #8800 from NixOS/backport-8712-to-2.15-maintenance
[Backport 2.15-maintenance] [Backport 2.16-maintenance] restoreMountNamespace(): Restore the original root directory
2023-08-07 19:31:54 +02:00
Eelco Dolstra
9783bbad54 restoreMountNamespace(): Restore the original root directory
This is necessary when we're in a chroot environment, where the
process root is not the same as the root of the mount namespace
(e.g. in nixos-enter).

Fixes #7602.

(cherry picked from commit e54538c461)
(cherry picked from commit 92e198f1db)
2023-08-07 17:02:09 +00:00
Eelco Dolstra
6aba9b0c32
Merge pull request #8554 from NixOS/backport-8552-to-2.15-maintenance
[Backport 2.15-maintenance] GC server: Clear O_NONBLOCK on the right file descriptor
2023-06-20 13:00:29 +02:00
Eelco Dolstra
b8a587d33f GC server: Clear O_NONBLOCK on the right file descriptor
The bug fix in 6d30f9e6fe erroneously
cleared O_NONBLOCK on the server rather than client FD (leaving both
in an incorrect state).

Fixes #8551.

(cherry picked from commit a6a75ecad8)
2023-06-20 10:13:10 +00:00
Eelco Dolstra
de3f035d12
Merge pull request #8535 from emilazy/backport-8240-to-2.15-maintenance
[Backport 2.15-maintenance] ci: Always run with sandbox, even on Darwin
2023-06-19 12:42:12 +02:00
Yorick van Pelt
8a9b22b604 create pathAccessible, use it to infer default dirs
(cherry picked from commit 2c462486fe)
2023-06-18 04:03:26 +01:00
Yorick van Pelt
a1c22a7c10 getDefaultNixPath: ignore EPERM
(cherry picked from commit a6c78ba367)
2023-06-18 04:03:26 +01:00
Yorick van Pelt
24e1dc4d74 Call getDefaultSSLCertFile() only when none is specified
This does pathExists on various paths, which crashes on EPERM in the
macOS sandbox.

(cherry picked from commit b7cde90c6b)
2023-06-18 04:03:26 +01:00
Silvan Mosberger
75ec8e3130 ci: Always run with sandbox, even on Darwin
And fix a test failure in the sandbox due to /home
existing on Darwin but not being accessible in the sandbox since it's a
symlink to /System/Volumes/Data/home, see
https://github.com/NixOS/nix/actions/runs/4205378453/jobs/7297384658#step:6:2127:

    C++ exception with description "error: getting status of /home/schnitzel/darmstadt/pommes: Operation not permitted" thrown in the test body.

On Linux this wasn't a problem because there /home doesn't exist in the sandbox

(cherry picked from commit be48907470)
2023-06-18 04:03:26 +01:00
Théophane Hufschmitt
1b31d04e74
Merge pull request #8465 from NixOS/backport-8399-to-2.15-maintenance
[Backport 2.15-maintenance] Properly report build errors on chrooted stores
2023-06-07 09:18:49 +02:00
Théophane Hufschmitt
2da1b12062 Properly report build errors on chrooted stores
When encountering a build error, Nix moves the output paths out of the
chroot into their final location (for “easier debugging of build
failures”). However this was broken for chroot stores as it was moving
it to the _logical_ location, not the _physical_ one.

Fix it by moving to the physical (_real_) location.

Fix https://github.com/NixOS/nix/issues/8395

(cherry picked from commit d16a1994fb)
2023-06-06 22:17:26 +00:00
Eelco Dolstra
d609b64bb2 Bump version 2023-05-23 17:18:24 +02:00
John Ericson
9204ab4d58
Merge pull request #8350 from NixOS/backport-8154-to-2.15-maintenance
[Backport 2.15-maintenance] Make `nix-collect-garbage -d` look into more places
2023-05-16 12:45:30 -04:00
Théophane Hufschmitt
5c183986d0 test the garbage collection with the old profile dir
Regression test for https://github.com/NixOS/nix/issues/8294

(cherry picked from commit e97e9e9f00)
2023-05-16 13:52:04 +00:00
Théophane Hufschmitt
81466aff45 Make nix-collect-garbage -d look into more places
Make it look into the new-style profiles dir, the old-style one, and the
target of `~/.nix-profile` to be sure that we don't miss anything

(cherry picked from commit 64b0cc5bc4)
2023-05-16 13:52:04 +00:00
John Ericson
02b2ea1e1a
Merge pull request #8320 from NixOS/backport-8310-to-2.15-maintenance
[Backport 2.15-maintenance] Fix `nix print-dev-env` & `nix develop` with drv paths
2023-05-12 00:02:10 -04:00
John Ericson
fec05fad3a Fix nix print-dev-env & nix develop with drv paths
Fixes #8309

This regression was because both `CmdDevelop` and `CmdPrintDevEnv` were
switched to be `InstallableValueCommand` subclasses, but actually
neither should have been.

The `nixpkgsFlakeRef` method should indeed not be on the base
installable class, because "flake refs" and "nixpkgs" are not
installable-wide notions, but that doesn't mean these commands should
only accept installable values.

(cherry picked from commit a93110ab19)
2023-05-11 21:08:10 +00:00
Robert Hensing
ab14087ea3
Merge pull request #8237 from NixOS/backport-8231-to-2.15-maintenance
[Backport 2.15-maintenance] Gate experimental features in `DerivationOutput::fromJSON`
2023-04-18 17:36:25 +02:00
John Ericson
bef52e525d Gate experimental features in DerivationOutput::fromJSON
This is an entry point for outside data, so we need to check enabled
experimental features here.

(cherry picked from commit aa74c7b0bc)
2023-04-18 13:43:19 +00:00
John Ericson
80afafdbd4
Merge pull request #8221 from NixOS/backport-8214-to-2.15-maintenance
[Backport 2.15-maintenance] Display valid installable in `InstallableDerivedPath::parse` warning
2023-04-15 10:37:59 -04:00
John Ericson
e79de4791d Legacy vs non-legacy to_string/parse for DerivedPath
As requested by @roberth, it is good to call out the specific instances
we care about, which is `!` for the RPC protocols, and `^` for humans.

This doesn't take advantage of parametricity as much, but since the
human and computer interfaces are good to decouple anyways (we don't
care if they drift further apart over time in the slightest) some
separation and slight duplication is fine.

Also, unit test both round trips.

(cherry picked from commit ee420ac64e)
2023-04-15 12:15:19 +00:00