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

19479 commits

Author SHA1 Message Date
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
Leandro Reina
134530a534 Merge remote-tracking branch 'upstream/master' into lfs 2025-02-03 19:07:20 +01: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
Steve Walker
453e8dc067 Fix flakes follow symlinks
Co-authored-by: Jan Christoph Bischko <jbischko@barracuda.com>
2025-02-02 08:30:04 +07:00
Brian McKenna
f62a287163 Only enable big-obj on Windows 2025-02-01 21:36:50 +11:00
John Ericson
d949c8de7c
Merge pull request #12249 from nix-windows/stack-size
Remove broken stack size logic from Windows
2025-01-31 22:57:01 -05:00
Eelco Dolstra
8006196c55 tests/functional/fetchGit.sh: Add a test for NAR hash mismatches 2025-01-31 17:03:27 +01:00
Eelco Dolstra
9e240ecced Remove isConsideredLocked() 2025-01-31 17:03:27 +01:00
Eelco Dolstra
4113fdf2f0 Allow use of lock files with unlocked entries as long as they have a NAR hash
Fixes #12364.
2025-01-31 17:03:27 +01:00
Eelco Dolstra
5dec1dc086 fetchGit/fetchTree: Allow fetching using only a NAR hash
Fixes #12027.
2025-01-31 17:03:27 +01:00
Eelco Dolstra
a142803c28 tests/functional/fetchGit.sh: Drop unnecessary --impure flags 2025-01-31 17:03:27 +01:00
Eelco Dolstra
39ef2e28cc
Merge pull request #12375 from DeterminateSystems/fetchTree-errors
fetchTree: Distinguish between fetchGit and fetchTree consistently in error messages
2025-01-31 15:26:43 +01:00
Eelco Dolstra
5f6658b9c9 fetchTree: Distinguish between fetchGit and fetchTree consistently 2025-01-31 15:10:29 +01:00
Brian McKenna
26539a087f Add mbig-obj flag to allow cross-compiling libexpr to mingw32 2025-01-31 22:53:42 +11:00
Brian McKenna
7c8c71f8e9 Totally exclude nix::setStackSize on Windows 2025-01-31 21:11:45 +11:00
Eelco Dolstra
c8b22643ba readHead(): Make sure we're returning the HEAD ref line
If we previously fetched by revision, the output of "git ls-remote"
won't start with the expected line like

  ref: refs/heads/master HEAD

but will be something like

  5c4410e3b9891c05ab40d723de78c6f0be45ad30        refs/heads/5c4410e3b9891c05ab40d723de78c6f0be45ad30

This then causes Nix to treat that revision as a refname, which then
leads to warnings like

  warning: could not update cached head '5c4410e3b9891c05ab40d723de78c6f0be45ad30' for 'file:///tmp/repo'
2025-01-30 19:03:34 +01:00
Eelco Dolstra
ee9fa0d360 Git fetcher: Don't use refspec <rev>:<rev>
This causes Git to create a local ref named refs/head/<rev>, e.g.

  $ git -C ~/.cache/nix/gitv3/11irpim06vj4h6c0w8yls6kx4hvl0qd0gr1fvk47n76g6wf1s1vk ls-remote --symref .
  5c4410e3b9891c05ab40d723de78c6f0be45ad30        refs/heads/5c4410e3b9891c05ab40d723de78c6f0be45ad30
  7f6bde8a20de4cccc2256f088bc5af9dbe38881d        refs/heads/7f6bde8a20de4cccc2256f088bc5af9dbe38881d

which confuses readHead(), leading to errors like

  fatal: Refusing to point HEAD outside of refs/
  warning: could not update cached head 'd275d93aa0bb8a004939b2f1e87f559f989453be' for 'file:///tmp/repo'
2025-01-30 19:03:34 +01:00
Eelco Dolstra
9f72d5bce9 Git fetcher: Don't pass URL query parameters for file:// URLs
Git interprets them as part of the file name, so passing parameters
like 'rev' breaks. Only relevant for testing (when _NIX_FORCE_HTTP is
set) and local bare repos.
2025-01-30 19:03:34 +01:00
Eelco Dolstra
3032512425 GitExportIgnoreSourceAccessor: Don't show «unknown»
In general we should set the path display prefix on the inner
accessor, so we now pass the display prefix to getAccessor().
2025-01-30 12:41:02 +01:00
Eelco Dolstra
177a067d66
Merge pull request #12372 from roberth/test-characterisation-log-to-stderr
tests/functional/characterisation/framework: Log to stderr
2025-01-30 11:34:39 +01:00
Eelco Dolstra
102d90ebf0 Fix duplicate setPathDisplay()
Fixes messages like 'copying /tmp/repo/tmp/repo to the store'. The
PosixSourceAccessor already sets the prefix. Setting the prefix twice
shouldn't be a problem, but GitRepoImpl::getAccessor() returns a
wrapped accessor so it's not actually idempotent.
2025-01-30 11:27:24 +01:00
Eelco Dolstra
cfe93299b1
Merge pull request #12378 from DeterminateSystems/fix-shellcheck
Fix shellcheck warnings
2025-01-29 15:49:00 +01:00
Eelco Dolstra
fa87ad6a7c Fix shellcheck warnings 2025-01-29 15:34:49 +01:00
Robert Hensing
a5de2dd274 tests/functional/characterisation/framework: Log to stderr
It seems that `meson test --print-errorlogs` only captures stderr,
so this makes it forward the logs as intended.

We might want to redirect stdout in our common setup script instead.
2025-01-28 09:26:33 +01:00
Robert Hensing
fbe2940a08
Merge pull request #12363 from roberth/issue-12161
Issue #12161, add `meta.mainProgram`
2025-01-28 09:15:14 +01:00