1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 03:56:01 +01:00
Commit graph

20720 commits

Author SHA1 Message Date
Robert Hensing
a1b3934a78 maintainers: Add script for release notes todo list 2025-08-21 14:19:22 +02:00
Eelco Dolstra
3826d51a65
Merge pull request #13565 from NixOS/prefetch-inputs
Add `nix flake prefetch-inputs` command
2025-08-21 12:30:17 +02:00
Eelco Dolstra
615b10cb44
Merge pull request #13800 from NixOS/concurrent-eval-cache
Use WAL mode for SQLite cache databases
2025-08-21 11:42:15 +02:00
John Ericson
e2b984704a
Merge pull request #13801 from obsidiansystems/move-sandbox-path-closure-code
Make sure `settings.sandboxedPaths` is closed outside `DerivationBuilder`
2025-08-20 19:15:16 -04:00
John Ericson
4c76db8e7c Make sure settings.sandboxedPaths is closed outside DerivationBuilder
This is a nicer separation of concerns --- `DerivationBuilder` just
mounts the extra paths you tell it too, and the outside world is
responsible for making sure those extra paths make sense.

Since the closure only depends on global settings, and not
per-derivation information, we also have the option of moving this up
further and caching it across all local builds. (I only just realized
this after having done this refactor. I am not doing that change at this
time, however.)
2025-08-20 18:49:11 -04:00
John Ericson
08e42e20fa
Merge pull request #13769 from obsidiansystems/simplify-derivation-building-goal
Handle structured attrs, "export references graph" outside of `DerivationBuilder`
2025-08-20 18:05:04 -04:00
John Ericson
1d3ddb21fa Further consolidate environment variable processing outside DerivationBuilder
Now, `DerivationBuilder` only concerns itself with `finalEnv` and
`extraFiles`, in straightforward unconditional code. All the fancy
desugaring logic is consolidated in `DerivationBuildingGoal`.

We should better share the pulled-out logic with `nix-shell`/`nix
develop`, which would fill in some missing features, arguably fixing
bugs.
2025-08-20 16:54:17 -04:00
John Ericson
e3c74f5a13 Desugar structured attrs, "export reference graph" outside DerivationBuilder
I think this is a better separation of concerns. `DerivationBuilder`
doesn't need to to the final, query-heavy details about how these things
are constructed. It just operates on the level of "simple, stupid" files
and environment variables.
2025-08-20 16:54:17 -04:00
John Ericson
92b10cf3f5 DerivationBuilderImpl::writeStructuredAttrs remove a rewrite
As much as I prefer rewriting the parsed rather than unparsed JSON for
elegance, this gets in the way of the separation of concerns that I am
trying to do.

As a practical matter, any rewriting that this did will also be done by
the second round of rewriting that remains below, so removing this code
should have no effect.
2025-08-20 16:54:17 -04:00
John Ericson
2767ae35d9 Deduplicate "export reference graph" logic a bit
The first part on `drvOptions.exportReferencesGraph` is the same in both
cases. It is just how the information is finally rendered that is
different.
2025-08-20 16:54:17 -04:00
John Ericson
ca86d34077
Merge pull request #13799 from obsidiansystems/typed-sandbox-paths
Make `sandbox-settings` better typed, get `globals.hh` out of other headers
2025-08-20 16:50:34 -04:00
John Ericson
a712445a7a Make Settings::sandboxPaths well-typed
Parsing logic is moved from `DerivationBuilder`, where is doesn't
belong, to `Settings` itself, where it does.
2025-08-20 16:24:37 -04:00
John Ericson
52212635db No more globals.hh in headers
This is needed to rearrange include order, but I also think it is a good
thing anyways, as we seek to reduce the use of global settings variables
over time.
2025-08-20 16:24:37 -04:00
John Ericson
bce29ab2cf Move header outside Unix-only portion
We'll neeed some definitions elsewhere
2025-08-20 16:24:37 -04:00
John Ericson
8463fef161 Expose ChrootPath, PathsInChroot
Will want these for settings in a moment.
2025-08-20 16:24:37 -04:00
John Ericson
d53c7b816b Push #include down to .cc file
That is where it should be.
2025-08-20 16:24:37 -04:00
John Ericson
4ab579b469 Remove constructor from ChrootPath
I rather use designated initializers.
2025-08-20 16:24:36 -04:00
Eelco Dolstra
0df147b145 Bump the version of the SQLite caches
This avoids problems with older versions of Nix that don't put the
caches in WAL mode. That's generally not a problem, until you do something like

  nix build --print-out-paths ... | cachix

which deadlocks because cachix tries to switch the caches to truncate
mode, which requires exclusive access. But the first process cannot
make progress because the cachix process isn't reading from the pipe.
2025-08-20 20:44:58 +02:00
Eelco Dolstra
4ab8ff5b4c SQLite: Use std::filesystem::path 2025-08-20 20:44:21 +02:00
Eelco Dolstra
349d2c58e5 Use WAL mode for SQLite cache databases
With "truncate" mode, if we try to write to the database while another
process has an active write transaction, we'll block until the other
transaction finishes. This is a problem for the evaluation cache in
particular, since it uses long-running transactions.

WAL mode does not have this issue: it just returns "busy" right away,
so Nix will print

  error (ignored): SQLite database '/home/eelco/.cache/nix/eval-cache-v5/...' is busy

and stop trying to write to the evaluation cache. (This was the
intended/original behaviour, see AttrDb::doSQLite().)
2025-08-20 20:34:43 +02:00
Jörg Thalheim
bb600e1048
Merge pull request #13796 from NixOS/onboarding-room-list
onboarding.md: List the private rooms
2025-08-19 23:47:17 +02:00
John Ericson
088cc176f1
Merge pull request #13795 from xokdvium/factor-out-s3url
libstore: Introduce ParsedS3URL type
2025-08-19 17:28:52 -04:00
Robert Hensing
4134258c03
onboarding.md: List the private rooms
We forgot one in the latest onboarding
2025-08-19 23:00:32 +02:00
Sergei Zimmerman
69fcc2cfc1
libstore: Introduce ParsedS3URL type
This systematizes the way our s3:// URLs are parsed in filetransfer.cc.
Yoinked out and refactored out of [1].

[1]: https://github.com/NixOS/nix/pull/13752

Co-authored-by: Bernardo Meurer Costa <beme@anthropic.com>
2025-08-19 23:39:18 +03:00
John Ericson
a92a996dba
Merge pull request #13793 from xokdvium/c++23
treewide: Bump C++ standard version to C++23
2025-08-19 12:37:17 -04:00
Jörg Thalheim
5c0eff24d5
Merge pull request #13784 from NixOS/queryPathInfo-dont-disconnect
Fix client disconnect when queryPathInfo() returns a negative result
2025-08-19 17:16:47 +02:00
Sergei Zimmerman
03101cc839
treewide: Bump C++ standard version to C++23
Compilers in nixpkgs have caught up and major distros
should also have recent enough compilers. It would be
nice to have newer features like more full featured
ranges and deducing this.
2025-08-19 15:33:27 +03:00
tomberek
f3bd18f2b4
Merge pull request #13790 from xokdvium/fix-ci
libstore: Fix formatting
2025-08-18 16:49:00 -04:00
Sergei Zimmerman
62018b3a7f
libstore: Fix formatting
Wasn't caught by CI because the PR wasn't fresh enough
and didn't have formatting checks enabled.
2025-08-18 23:24:10 +03:00
tomberek
dc2478fe79
Merge pull request #13340 from mkenigs/better-error
Improve error when can't acquire db lock
2025-08-18 15:27:58 -04:00
Sergei Zimmerman
8283a20c6a
Merge pull request #13789 from xokdvium/nix-2.3-insecure-fix
hydra: Fix otherNixes.nix_2_3
2025-08-18 21:58:35 +03:00
Sergei Zimmerman
051290b155
hydra: Fix otherNixes.nix_2_3
25.05 has it marked as insecure, but we don't care about it
for testing purposes.
2025-08-18 21:56:20 +03:00
Sergei Zimmerman
b263bfcecd
Merge pull request #13785 from xokdvium/25.05-nixpkgs
flake: nixpkgs: nixos-unstable -> nixos-25.05-small
2025-08-18 20:57:46 +03:00
Sergei Zimmerman
73f6729147
git-blame-ignore-revs: Add nixfmt 1.0.0 reformat 2025-08-18 20:30:54 +03:00
Sergei Zimmerman
1d943f5819
flake: Apply nixfmt 1.0.0 2025-08-18 20:29:45 +03:00
Robert Hensing
aa0dc0d7e7
Merge pull request #13757 from fzakaria/issue-13215
libfetchers/git: add support for '.' in gitmodules
2025-08-18 19:16:54 +02:00
Sergei Zimmerman
fc33681583
flake: nixpkgs: nixos-unstable -> nixos-25.05-small
About time we upgraded our nixpkgs flake input. Ideally
we'd have automation to do this.

Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/adaa24fbf46737f3f1b5497bf64bae750f82942e?narHash=sha256-qhFMmDkeJX9KJwr5H32f1r7Prs7XbQWtO0h3V0a0rFY%3D' (2025-05-13)
  → 'github:NixOS/nixpkgs/cd32a774ac52caaa03bcfc9e7591ac8c18617ced?narHash=sha256-VtMQg02B3kt1oejwwrGn50U9Xbjgzfbb5TV5Wtx8dKI%3D' (2025-08-17)
2025-08-18 20:04:57 +03:00
Eelco Dolstra
f51779ee25 RemoteStore::addToStoreFromDump(): Invalidate cache entry for added path 2025-08-18 18:12:42 +02:00
Eelco Dolstra
c82b67fa05 BasicClientConnection::queryPathInfo(): Don't throw exception for invalid paths
This caused RemoteStore::queryPathInfoUncached() to mark the
connection as invalid (see
RemoteStore::ConnectionHandle::~ConnectionHandle()), causing it to
disconnect and reconnect after every lookup of an invalid path. This
caused huge slowdowns in conjunction with
19f89eb684 and lazy-trees.
2025-08-18 18:12:42 +02:00
Eelco Dolstra
48b600d995
Merge pull request #13783 from xokdvium/lowdown-cross
packaging: Fix lowdown cross
2025-08-18 13:17:13 +02:00
Sergei Zimmerman
0216775ab7
packaging: Fix lowdown cross
Stupid mistake on my part. `binaryTarballCross.x86_64-linux.x86_64-unknown-freebsd` now
builds as expected.
2025-08-18 12:57:04 +03:00
Jörg Thalheim
d48e04b05a
Merge pull request #13780 from xokdvium/lowdown-2
libcmd: Fix rendering of absolute URLs in markdown, update lowdown to 2.0.2
2025-08-18 08:54:05 +02:00
Farid Zakaria
b21304fe4c
libfetchers/git: Add support for '.' in gitsubmodules
Period '.' is a special branch name in the gitsubmodule file which
represents the branch of the parent repository [1].

We add support for this by registering the ref of the InputAccessor to
be that of the parent input if '.' is encountered.

Fixes #13215

[1]: man gitmodules
2025-08-18 00:28:20 +03:00
Sergei Zimmerman
3ffeed497a
packaging: Update lowdown to 2.0.2
Nixpkgs has been updated with this version and seems
like next stable nixos release will ship with lowdown 2.0.
2025-08-17 20:49:50 +03:00
Sergei Zimmerman
da8759bb41
libcmd: Fix rendering of absolute URLs in markdown
lowdown >= 1.4.0 supports LOWDOWN_TERM_NORELLINK to render
absolute urls. This is useful, since we want to keep links to
web resources and such intact.
2025-08-17 20:31:34 +03:00
Jörg Thalheim
f6db80a553
Merge pull request #13779 from vog/patch-1
Fix NIX_CONF_DIR description
2025-08-17 18:20:37 +02:00
Volker Diels-Grabsch
1d7ac6603c
Fix NIX_CONF_DIR description
Fix description of `NIX_CONF_DIR`. It currently say that it defaults to `prefix/etc/nix`, which would mean `/nix/etc/nix` on default installations, and contradicts the description in `conf-file-prefix.md`.

This fix makes the description of `NIX_CONF_DIR` consistent with `conf-file-prefix.md`, assuming that the latter is correct.
2025-08-17 17:28:46 +02:00
Sergei Zimmerman
4284497d98
Merge pull request #13778 from xokdvium/fake-references-in-benchmark-drvs
libstore-tests: Obfuscate derivation paths in drv files for benchmarks
2025-08-17 17:25:12 +03:00
Sergei Zimmerman
e244e32308
libstore-tests: Obfuscate derivation paths in drv files for benchmarks
Otherwise this might form a valid reference and nix repo will not be fetched
as a FOD.
2025-08-17 16:57:04 +03:00
Jörg Thalheim
72c8aa8bb1
Merge pull request #13774 from xokdvium/fix-authorization
tests/nixos: Fix daemon store reference in authorization test
2025-08-17 14:48:15 +02:00