Commit Graph
106 Commits
Author SHA1 Message Date
Robert Hensing d48101109d nix-flake: Move primops registration to configureEvalSettings 2025-03-26 11:15:02 +00:00
Robert Hensing 6a192ec0cd C API: (breaking) remove nix-flake-c global init 2025-03-26 11:15:02 +00:00
Jörg Thalheim 3b0b2fd8d6 libflake: fix double quoting when updating flakes 2025-03-07 04:00:24 +01:00
John Ericson de22f58dfc Introduce EvalStore::storePath
This abstracts over a common case. Good for brevity, and enabling
further experiments.
2025-02-19 21:24:26 -05:00
Eelco Dolstra 4206d95996 Remove sourcePathToStorePath()
It's no longer needed now that all store paths inside the evaluator
are logical rather than real paths.
2025-02-19 21:31:25 +01:00
Eelco Dolstra 99e78c37f7 Use UnionSourceAccessor to mount the chroot store on top of the real store directory 2025-02-19 12:54:09 +01:00
Robert Hensing 3556f6bf4c Write just ./.version on all components
This way it's easier to get right. See previous commit.
2025-02-18 11:41:35 +01:00
Leandro Reina b2d352e6a3 Add inputs.self.lfs 2025-02-13 17:59:27 +01:00
Eelco Dolstra 5c552b62fc lockFlake(): When refetching a locked flake, use the locked ref
Otherwise we may accidentally update a lock when we shouldn't.

Fixes #12445.
2025-02-12 14:53:04 +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 6e2fcb7e29 Parser: Respect the accessor of the source file for relative paths 2025-02-06 16:31: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
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
mergify[bot] 24d11d22c3 Merge pull request #12286 from stevalkr/flakes_symlink_path
Fix flakes follow symlinks
2025-02-02 03:11:20 +00:00
Steve WalkerandJan Christoph Bischko 453e8dc067 Fix flakes follow symlinks
Co-authored-by: Jan Christoph Bischko <jbischko@barracuda.com>
2025-02-02 08:30:04 +07: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
Robert Hensing 96e550efc5 Format .nix files
... with nixfmt (rfc style)
2025-01-24 17:04:02 +01:00
Eelco Dolstra 7dfff58292 Rename InputPath -> InputAttrPath
Fixes #12098.
2025-01-23 16:34:35 +01:00
Eelco Dolstra 8e05ddfd84 Use fs::symlink_exists 2025-01-20 16:48:20 +01:00
Eelco Dolstra 89e5047e12 Fix libflake build on mingw 2025-01-20 15:50:04 +01:00
Eelco Dolstra f5548c17ed getSourcePath(): Return std::filesystem::path 2025-01-17 13:21:53 +01:00
Eelco Dolstra f0271090b2 Drop unused 'settings' argument 2025-01-16 23:47:57 +01:00
Eelco Dolstra 5807b5cda0 Trivial changes from lazy-trees
Rename allowLookup -> useRegistries, rename lockRootPath ->
followsPrefix, drop an unnecessary getFlake() variant.
2025-01-16 23:44:18 +01:00
Eelco Dolstra 043df13f72 Merge pull request #10089 from edolstra/relative-flakes
Improve support for relative path inputs
2025-01-16 14:21:27 +01:00
Eelco Dolstra 550fe889ee Merge remote-tracking branch 'origin/master' into relative-flakes 2025-01-16 11:05:10 +01:00
John Ericson 0c101679b4 Merge pull request #12261 from NixOS/packaging
Packaging cleanups, add RossComputerGuy as `-llvm` maintainer
2025-01-15 17:25:15 -05:00
John Ericson e02026adae Merge pull request #12254 from DeterminateSystems/fix-relative-path-on-cli
Fix relative 'path:' flakerefs in the CLI
2025-01-15 15:19:56 -05:00
mergify[bot] c45dfeeef3 Merge pull request #12220 from DeterminateSystems/allow-dirty-locks
Add setting 'allow-dirty-locks'
2025-01-15 20:18:28 +00:00
Robert Hensing 7ad02b62e0 refactor: Remove redundant parameters 2025-01-15 20:01:00 +01:00
Robert Hensing cab347b4eb refactor: Move ld=gold rule to mesonBuildLayer 2025-01-15 20:01:00 +01:00
Eelco Dolstra ff9d886f3c Use isAbsolute() 2025-01-14 17:42:26 +01:00
Eelco Dolstra ff8e2fe84e Fix relative 'path:' flakerefs in the CLI
And handle relative 'git+file:' flakerefs while we're at it (these
crashed with an assertion failure).

Fixes #12248.
2025-01-14 17:30:13 +01:00
Eelco Dolstra cd0127f957 Merge remote-tracking branch 'origin/master' into relative-flakes 2025-01-13 14:13:56 +01:00
Tristan Ross 47cf93ba80 Add LLVM to Flake 2025-01-10 18:08:27 -08:00
Eelco Dolstra e161393299 Add setting 'allow-dirty-locks'
This allows writing lock files with dirty inputs, so long as they have
a NAR hash. (Currently they always have a NAR hash, but with lazy
trees that may not always be the case.)

Generally dirty locks are bad for reproducibility (we can detect if
the dirty input has changed, but we have no way to fetch it except
substitution). Hence we don't allow them by default.

Fixes #11181.
2025-01-10 17:55:30 +01:00
Eelco Dolstra 83ff523865 parsePathFlakeRefWithFragment(): Handle query params in the non-git case
Backported from lazy-trees.
2025-01-09 12:17:09 +01:00
Eelco Dolstra 28caa35a97 parsePathFlakeRefWithFragment(): Handle 'path?query' without a fragment
Commands like `nix flake metadata '.?submodules=1'` ignored the query
part of the URL, while `nix build '.?submodules=1#foo'` did work
correctly because of the presence of the fragment part.
2025-01-08 18:38:53 +01:00
Eelco Dolstra 4077aa43a8 ParsedURL: Remove base field 2025-01-07 14:52:00 +01:00
Eelco Dolstra f705ce7f9a ParsedURL: Remove url field
This prevents a 'url' field that is out of sync with the other
fields. You can use to_string() to get the full URL.
2025-01-07 14:46:03 +01:00
Eelco Dolstra 0792152627 Rename Override -> OverrideTarget 2025-01-07 13:54:19 +01:00
Eelco Dolstra e8c7dd9971 Rename allowRelative -> preserveRelativePaths 2025-01-07 13:44:08 +01:00
Connor Baker 359a0840e2 packaging: use optimization level 3 and LTO by default 2025-01-01 21:59:37 -08:00
Eelco Dolstra 9223d64ac6 Remove dead code 2024-12-23 16:03:13 +01:00
Eelco Dolstra 8534c4222c Merge remote-tracking branch 'origin/master' into relative-flakes 2024-12-18 21:09:27 +01:00
Eelco Dolstra b167e2c415 Work around clang/libc++ issue 2024-12-16 14:58:39 +01:00
Eelco Dolstra d2e1d4916a lookupInFlakeCache(): Fix O(n) time lookup 2024-12-16 14:58:39 +01:00
Eelco Dolstra d1f20e3510 Make FetchedFlake a struct 2024-12-16 14:58:25 +01:00