1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 02:21:16 +02:00
Commit graph

19248 commits

Author SHA1 Message Date
Eelco Dolstra
26b87e78b5 copyPathToStore(): Preserve symlinks
E.g. in a derivation attribute `foo = ./bar`, if ./bar is a symlink,
we should copy the symlink to the store, not its target. This restores
the behaviour of Nix <= 2.19.
2025-02-11 20:58:48 +01:00
Eelco Dolstra
92bf150b1c
Merge pull request #12421 from DeterminateSystems/self-input-attrs
Add `inputs.self.submodules` flake attribute
2025-02-10 17:35:46 +01:00
Eelco Dolstra
2819d8b66a Add release note 2025-02-10 17:19:34 +01:00
Eelco Dolstra
528b286cf7 Remove stray line 2025-02-10 17:14:55 +01:00
Eelco Dolstra
4b75edacd7 Restore NAR hash assertion 2025-02-10 17:13:17 +01:00
Eelco Dolstra
b813a764e0 Merge remote-tracking branch 'origin/master' into self-input-attrs 2025-02-10 17:01:19 +01:00
John Ericson
1f485b6c5e
Merge pull request #12430 from DeterminateSystems/relative-path-literals
Parser: Respect the accessor of the source file for relative paths
2025-02-10 10:28:44 -05:00
John Ericson
967d7b9846
Merge pull request #12441 from obsidiansystems/content-addressing-derivation
Rename to "content-address*ing* derivation"
2025-02-10 03:01:12 -05:00
John Ericson
cafefed421 Rename to "content-address*ing* derivation"
"content-address*ed*" derivation is misleading because all derivations
are *themselves* content-addressed. What may or may not be
content-addressed is not derivation itself, but the *output* of the
derivation.

The outputs are not *part* of the derivation (for then the derivation
wouldn't be complete before we built it) but rather separate entities
produced by the derivation.

"content-adddress*ed*" is not correctly because it can only describe
what the derivation *is*, and that is not what we are trying to do.

"content-address*ing*" is correct because it describes what the
derivation *does* --- it produces content-addressed data.
2025-02-10 01:12:56 -05:00
John Ericson
e80d333777
Document Store Derivations and Deriving Paths (#12290)
This is a big step documenting the store layer on its own, separately from the evaluator (and `builtins.derivation`).

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2025-02-10 01:30:07 +00:00
mergify[bot]
aa383a0b85
Merge pull request #12373 from roberth/fix-pre-commit
pre-commit/check-merge-conflicts-2: fix use outside dev shell
2025-02-07 11:07:12 +00:00
Robert Hensing
414c346560 test: Use skipTest instead of exit 0
This way shellcheck is ok with it, and it conveys that a significant
chunk of the test is skipped.
2025-02-07 11:20:18 +01:00
Robert Hensing
77a8386022 test: Fix shellcheck by giving git-hashing scripts shebangs
This seems to be the way to do it now, even though I can't run them
without setting at least one env var.
I'll only fix shellcheck for now. Don't shoot the messenger.

It isn't quite clear to me why the previous commit masked this problem,
but I'm glad shellcheck has an effect or more effect now.
2025-02-07 10:56:15 +01:00
Robert Hensing
73060b4972 pre-commit/check-merge-conflicts-2: fix use outside dev shell
Note that this is just a script that is meant to run outside a
derivation (but also can be called by a derivation builder).
`touch $out` does not belong in it.

`touch $out` worked accidentally in the derivation-based check,
and also in the dev shell, but if pre-commit is invoked without
the dev shell it would fail.
2025-02-07 10:56:15 +01:00
Eelco Dolstra
7096acc74d Parser: Respect the accessor of the source file for relative paths
Previously we only returned paths in rootFS, which is wrong and only
worked because currently all our source trees are in rootFS.
2025-02-06 16:33:43 +01:00
Eelco Dolstra
6e2fcb7e29 Parser: Respect the accessor of the source file for relative paths 2025-02-06 16:31:42 +01:00
John Ericson
fc83c6ccb3
Merge pull request #12379 from silvanshade/blake3-c
Add BLAKE3 hashing algorithm
2025-02-05 22:43:44 -05:00
silvanshade
7fd2125573
Add BLAKE3 to documentation 2025-02-05 17:49:15 -07:00
silvanshade
1f56ea4c72
Add BLAKE3 hashing algorithm
This uses the single-threaded C-based routines from libblake3.

This is not optimal performance-wise but should be a good starting point
for nix compatibility with BLAKE3 hashing until a more performant
implementation based on the multi-threaded BLAKE3 routines
(written in Rust) can be developed.
2025-02-05 17:49:15 -07:00
John Ericson
a562d0b6ce
Merge pull request #12386 from DeterminateSystems/git-fixes
Git fetcher: Don't create refs when fetching by revision
2025-02-05 15:18:58 -05:00
Eelco Dolstra
1a8dfc0540
Merge pull request #12415 from silvanshade/fix-shellcheck-lints
Fix shellcheck lints
2025-02-05 19:11:09 +01:00
Eelco Dolstra
d2425c5d6a
Merge pull request #12422 from ilya-bobyr/fish-profile-use-set-local
nix-profile.fish: set --local NIX_LINK
2025-02-05 09:38:51 +01:00
Illia Bobyr
50300772e4
nix-profile.fish: set --local NIX_LINK
Using `set --local` is better than using `set`/`set --erase`.  `--local`
will preserve any existing `NIX_LINK` value.  And the local variable is
automatically removed for any execution path.
2025-02-04 16:01:29 -08:00
Eelco Dolstra
38f391444b Add a test for a flake referencing a flake that has inputs.self 2025-02-04 22:14:38 +01:00
Eelco Dolstra
3e8cd2ffe6
Merge pull request #12412 from obsidiansystems/simplify-state-machine-2
Simplify state machine 2
2025-02-04 21:24:42 +01:00
Eelco Dolstra
25fcc8d1ab Add inputs.self.submodules flake attribute
This allows a flake to specify that it needs Git submodules to be
enabled (or disabled, if we ever change the default) on the top-level
flake. This requires the input to be refetched, but since the first
fetch is lazy, this shouldn't be expensive.

Currently the only attribute allowed by `inputs.self` is `submodules`,
but more can be added in the future (e.g. a `lazy` attribute to opt in
to lazy tree behaviour).

Fixes #5312, #9842.
2025-02-04 21:16:33 +01:00
John Ericson
f90ba3a7c1
Update tests/functional/flakes/symlink-paths.sh 2025-02-04 11:25:14 -05:00
Eelco Dolstra
01598487b7 Add FIXME 2025-02-04 16:41:10 +01:00
Eelco Dolstra
c74ad6b32b Remove FlakeRef::fetchTree() 2025-02-04 16:26:22 +01:00
Eelco Dolstra
1ab97a70f5 fetchOrSubstituteTree(): Return an accessor
This prepares lazy access to flake.nix etc.
2025-02-04 16:14:34 +01:00
Eelco Dolstra
3c109095de Use 'nix flake prefetch' to get the store path of a flake
Future-proofing for when 'nix flake metadata' won't return a store
path anymore.
2025-02-04 15:24:50 +01:00
Eelco Dolstra
02e6286e8f
Merge pull request #12414 from ilya-bobyr/fish-profile-daemon-XDG_DATA_DIRS
nix-profile-daemon.fish: XDG_DATA_DIRS: .profile/share
2025-02-04 13:38:43 +01:00
Eelco Dolstra
5c6785e0c1
Merge pull request #12392 from obsidiansystems/simplify-state-machine
Simplify state machine
2025-02-04 12:08:35 +01:00
silvanshade
137ba71f02
Fix shellcheck lints 2025-02-03 17:47:37 -07:00
Illia Bobyr
85aa624126
nix-profile-daemon.fish: XDG_DATA_DIRS: .profile/share
It seems reasonable to add the `share` folder from the user profile into
`$XDG_DATA_DIRS` both for daemon and profile execution.  Nix could add
package shared files into this folder regardless of how the nix daemon
itself is running.
2025-02-03 16:24:14 -08:00
John Ericson
b3b741973e Inline inputsRealised 2025-02-03 13:15:49 -05:00
John Ericson
4b1753e661 Move repairClosure
This is necessary in order to inline `inputsRealised` in the next
commit by combing it with its adjacent function (i.e. with a small
diff).
2025-02-03 13:14:13 -05:00
John Ericson
2297cc0dab Inline getDerivation and loadDerivation 2025-02-03 13:13:04 -05:00
John Ericson
57463ab910 Inline closureRepaired 2025-02-03 13:13:04 -05:00
John Ericson
41274f3c3e Inline outputsSubstitutionTried 2025-02-03 13:13:04 -05:00
John Ericson
53946fe017 Narrow scope on some local variables 2025-02-03 13:13:04 -05:00
John Ericson
c73096ba5f
Merge pull request #12408 from obsidiansystems/debugging-instructions
More debugging documentation
2025-02-03 12:57:42 -05:00
John Ericson
243467e14b More debugging documentation
There are a few things I think people should know, post-Meson.
2025-02-03 10:08:13 -05:00
Eelco Dolstra
cba27bae6d
Merge pull request #12405 from ilya-bobyr/fish-profile-fix-ssl-cert-typo
nix-profile.fish: Typo NIX_SS{H => L}_CERT_FILE
2025-02-03 13:35:23 +01:00
Illia Bobyr
803fb83f7f
nix-profile.fish: Typo NIX_SS{H => L}_CERT_FILE 2025-02-02 22:51:47 -08:00
mergify[bot]
63c0ea5702
Merge pull request #12252 from ilya-bobyr/fish-profile-source-once-and-fmt
nix-profile{,-daemon}.fish: Do not source twice, fmt
2025-02-02 03:11:23 +00:00
mergify[bot]
24d11d22c3
Merge pull request #12286 from stevalkr/flakes_symlink_path
Fix flakes follow symlinks
2025-02-02 03:11:20 +00:00
mergify[bot]
340eae1f23
Merge pull request #12385 from DeterminateSystems/fix-git-workdir-path-display
Fix duplicate setPathDisplay()
2025-02-02 02:10:38 +00:00
mergify[bot]
b842103307
Merge pull request #12376 from DeterminateSystems/fetch-using-nar-hash
Allow fetching using NAR hash without --allow-dirty-locks
2025-02-02 02:10:35 +00:00
mergify[bot]
d5c00cfab1
Merge pull request #12387 from nix-windows/big-objs
Add mbig-obj flag to allow cross-compiling libexpr to mingw32
2025-02-02 01:32:15 +00:00