Commit Graph
19061 Commits
Author SHA1 Message Date
Jade Lovelace dad8a30906 release: 2.95.0 "Kakigōri"
Release produced with releng/create_release.xsh

Change-Id: I9d78b7d65053fb1d4a00dfd0d7ce9c93eba68365
2.95.0
2026-03-13 09:06:49 -07:00
Jade Lovelace dc7d5c45a4 release: release notes for 2.95.0
Release created with releng/create_release.xsh

Change-Id: I4cb4c81a440787fe5417369e5a058c8bb51c0cb1
2026-03-13 09:06:04 -07:00
Jade Lovelace fc5ab134d9 2.95.0: release name
Change-Id: I20fe0119cb3f011c3ea2f8355a120a8c2fecb610
2026-03-13 09:02:05 -07:00
rootile a05dbd2d7f docs: fix typo in distributed builds
Change-Id: Ie0bf1e6f2cecade786647aab1030279b57b7efb7
2026-03-13 16:24:51 +01:00
Jade Lovelace fada71a749 Update nixpkgs and nix2container
Fixes: https://git.lix.systems/lix-project/lix/issues/1152

Change-Id: I29ccfe46d7de43f521b88beff73a782a1fdb8d8c
2026-03-11 11:21:11 +00:00
Raito Bezarius 7c53a2cf9c manual/rl-next/f1-lang: reduce CLs to 1 in the chain
This avoids a large list of CLs when a user can discover all the CLs by
browsing the chain.

Change-Id: I1890eb87e8bf6f930d3d00c3f7156690bb8de068
Signed-off-by: Raito Bezarius <raito@lix.systems>
2026-03-10 17:09:22 +00:00
Raito Bezarius 5789f4b0a9 manual/rl-next: fine-tune the release notes
Follow up of https://gerrit.lix.systems/c/lix/+/5346?tab=comments for
the obvious pieces.

Change-Id: If0f640f786b0778d016187cb24c0513a48b5a30b
Signed-off-by: Raito Bezarius <raito@lix.systems>
2026-03-10 17:09:22 +00:00
Qyriad ca40ce8671 repl: always reload, but restore on failure
This might do more copies than are necessary. I think that's fine.

Sorry, :reload not reloading has been bothering the shit out of us.

Fixes #1115.

Change-Id: I7f4caca3dad39696ce66ce57b1a520836a6a6964
2026-03-10 15:05:25 +00:00
Qyriad 7f9b734aa5 repl: refactor initEnv into init+swap
Change-Id: Ica451fd95f55fe7893579c09eeca77db6a6a6964
2026-03-10 15:05:25 +00:00
rootile 03edd9f75d release-notes: add horrors to deprecated features credits
Change-Id: I73ed3198cfdbab15edddc9393010cafdf5050176
2026-03-09 22:44:29 +00:00
rootile e00ee5954e maintainers: unify issue references
So far, we had both `fj#` and `lix#` issue references in our release
notes, due to supporting both in the md files.
This commit unifies those in order for all references to be consistent.

Change-Id: I67c75784b460bfe4ebf214c2f6ac105cc60a7bad
2026-03-09 22:16:50 +00:00
Qyriad 861e5a7471 add misc/upgrade-lix.sh wrapper script, for nix-daemon@.service checks
Change-Id: I073b753f24e24eefe9d8f68543c4d1be6a6a6964
2026-03-09 22:28:51 +01:00
eldritch horrors 8c03cc961f nix/daemon: fix more stdio forwarding errors
kj can and will throw exceptions immediately without wrapping them as
promise results, and we must take care of these as well to not crash.

fixes #1150

Change-Id: Ifa29d0f3da4a6490f3e45d4c04a8fa49eaa20f43
2026-03-09 14:41:56 +01:00
K900 35fbfea6f8 package.nix: fix build with latest nixpkgs
mdbook-linkcheck was dropped from nixpkgs and replaced with mdbook-linkcheck2,
which is not entirely a drop-in replacement, but drop-in enough for us.

Change-Id: Iab03efab89ebae70811e0de3ea7cf0a9a059a9e4
2026-03-08 13:35:28 +03:00
Alois Wohlschlager fb9a575766 libstore: fix builder launch failure on older kernels
Since commit ac64c727b5, during launch of the
builder it is attempted to raise all capabilities into the ambient set.
Specifically, what "all" means here is determined by the Linux API headers Lix
was built against.

Occasionally, new capabilities are added in the Linux kernel, leading to
PR_CAP_AMBIENT_RAISE failing with EINVAL on the newly added capabilities if the
API headers are from after the change but the running kernel is from before.
Similarly to how capset already silently ignores nonexistent capabilities, we
ignore this error so the builder doesn't fail to launch unnecessarily.

Unfortunately it is very hard to test for this situation currently, since the
last time a capability was added was CAP_CHECKPOINT_RESTORE in Linux 5.9, and
all kernel versions in nixpkgs are newer than that.

Change-Id: Ibeb2f0757729b877bd3ca9f02e1aa4536a6a6964
2026-03-07 12:02:41 +01:00
eldritch horrors c914b9fc53 nix/daemon: wrap kj stdio forwarding errors nicely
not doing this has lix crash if stdio forwarding fails for odd reasons,
such as ssh failing to set up a connection due to transient dns errors.

cf #1148

Change-Id: I543b7444236e69d3c13b47fb6c6eb37c65b96763
2026-03-05 21:43:52 +00:00
Katalin Rebhan 981dd6e9b2 Add missing <sys/time.h> include
This is necessary for utimes and lutimes.

Change-Id: I352784606768f2b8a7de3c652e2a197e6a6a6964
2026-03-05 19:11:45 +01:00
Raito Bezarius 31a4f4547a Revert "libexpr/primops: allow storePath in pure evaluation mode"
This reverts commit 37ccd28c3b.

Reason for revert: https://git.lix.systems/lix-project/lix/issues/1147
More impurities were introduced than we wanted.

Fixes #1147.

Change-Id: Iec3b1d0e9a77484a68c6d9307a7a527fda236ed2
2026-03-05 17:09:46 +00:00
b7cf773540 libexpr: warn when encountering IFD with warn-import-from-derivation
This is intended to be a softer version of
`allow-import-from-derivation`, allowing for users to only flag when IFD
is encountered rather than error out

Based-on: https://github.com/NixOS/nix/pull/13279
Co-authored-by: gustavderdrache <alex.ford@determinate.systems>
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
Change-Id: I879a444e3a24b4e82a8cea3a5a94834c78c3924a
2026-03-05 13:39:12 +00:00
Qyriad 6f25c5468d cli: factor out and cleanup hasContent() for flake-show
Change-Id: I15c2df9a207639e81ff9030b737268526a6a6964
2026-03-04 19:44:21 +00:00
skye 8b38edaf1e libexpr: Migrate emitTreeAttrs to return a Value
Part of #1136 and progress towards #744

Change-Id: Iaa011161b26bda237bcf4424bf8262726a6a6964
2026-03-04 11:53:34 -05:00
Raito Bezariusandeldritch horrors 37ccd28c3b libexpr/primops: allow storePath in pure evaluation mode
`builtins.storePath` allows you to use "external" knowledge of present
store paths in your store to be used in your expressions.

This is sometimes used to avoid double wrapping store paths, for example
when dealing with nixpkgs sources (`builtins.storePath pkgs.path` is a
frequent pattern).

Unfortunately, using your external knowledge of present store paths is
technically impure because Flakes is about not depending on the *STATE*
of your store, no matter what you know about it or what you do to ensure
that your knowledge is accurate.

That being said, `builtins.storePath` is already possible in the
fragment of "pure Nixlang" via a clever use of `builtins.appendContext`.

Precisely:

```
  storePath = path:
  let path' = builtins.unsafeDiscardStringContext path;
  in
  # NOTE: merging the context set in all generality is impossible
because getContext on a pure path doesn't work.
    builtins.appendContext path' { ${path'} = { path = true; }; };
```

works in pure contexts.

Because of this, we deem that storePath should be allowed in pure
contexts and users do not have to come up with a `storePath` polyfill.

Fixes #402.

Change-Id: I5fff750a4feed082745431835db451f945249cfb
Signed-off-by: Raito Bezarius <raito@lix.systems>
2026-03-04 11:33:30 +00:00
Raito Bezarius e8015836e3 libcmd/profiles: keep derivations if keep-env-derivations = true
nix3 CLI never honored that setting.

When we update a nix3 profile element with new built store paths for
which we know the deriver (the derivation path which built it), we add
the derivation paths to the profile element to prevent garbage
collection the same way the nix2 CLI logic does.

Fixes #1095.

Change-Id: Icc236d174c5ce5ffe042d1c8e1968f6cb5b50359
Signed-off-by: Raito Bezarius <raito@lix.systems>
2026-03-03 22:13:02 +00:00
isabelandRaito Bezarius fc649250ec libexpr/flake-config: collect untrusted settings into one prompt
Instead of showing untrusted configuration items one by one, collect all
of them into one batched ask with 4 options:

- apply the configuration wholesale **for now** (yes)
- apply the configuration wholesale and trust it permanently (allow
  permanently)
- selectively choose subset (no)
- rejecting the configuration wholesale (no to all)

Note that we do not offer options to reject permanently a configuration,
that's what `--no-accept-flake-config` is for.

Individual prompts gain a new option to distinguish "yes for now" and
"yes forever".

Fixes #682.

Change-Id: I2492717ac277af33ea4ac9b1a11bd7d6d1bfe0db
2026-03-03 21:57:03 +00:00
Raito Bezarius b28723c5b9 libexpr/eval: do not confuse path and string with contexts in messages
In messages printed by the evaluator, we use showType(.) to say things
like "expected X, got Y" where X, Y can be string, string with context,
etc.

After changes in the Lix data model (pointer tagging and friends), paths
got squished inside a internal string type.

We missed updating `showType` to take this fact into account which
caused an unfortunate:

`error: expected a string but found a string with context:
/nix/store/wjf8rdpp63rhyasbzc7zfms1agf7pwyd-source`

while using a path on `builtins.getContext`

A test is added.

Change-Id: Ifb0129ead2ea1973fc17dc0133f8a694995536b1
Signed-off-by: Raito Bezarius <raito@lix.systems>
2026-03-03 21:36:13 +00:00
Raito Bezarius da37164630 libutil/strings: add partitionString
This partitions a string into two parts based on the first occurrence of
the separator.

This function handles the case when the separator never occur in the
target string by returning an optional<T> in the second argument of the
pair.

Change-Id: I9ad44375dbaa137a4d21d2408bc2ffa34fab62a7
Signed-off-by: Raito Bezarius <raito@lix.systems>
2026-03-03 20:54:08 +00:00
Raito Bezarius 135c28be53 libcmd: introduce enum traits for CLI parsing
Parsing and completing enumerations on the CLI was usually done by hand.

With this enum trait, the parsing and completion is automated away.

Change-Id: Icd49729564355d4c79e2c8050ce7e8b9d8e7eda3
Signed-off-by: Raito Bezarius <raito@lix.systems>
2026-03-03 20:54:08 +00:00
Raito Bezarius a2f1369d18 libmain: drop categories for dry-run and json args
36c4d6f592 introduced it commented. Zero
explanation why.

horrors suggested to drop it entirely because it hide the options in
categories but they are pretty common and we should make as much visible
as possible.

Change-Id: I09894b5ba0f2b2cce5869136914289fed034fce3
Signed-off-by: Raito Bezarius <raito@lix.systems>
2026-03-03 20:54:08 +00:00
Raito Bezarius b55260ce4a package/devshell: add pkgs.tree
Fixes #823.

Required for releng scripts.

Change-Id: I876784ffc868541924c2bb957aec58b704fd7dd2
Signed-off-by: Raito Bezarius <raito@lix.systems>
2026-03-03 20:22:34 +00:00
eldritch horrors 7a0a85b543 libstore: recursively delete cgroups
fixes #1143

Change-Id: I9f5cf5c127ac23e60e3232d85f338e467ed4f170
2026-03-03 15:49:52 +01:00
Raito Bezarius 092064db4c libstore/build: allow preferLocalBuild = true to bypass max-jobs = 0
When `max-jobs = 0`, our async semaphores have null capacity and
therefore no slot token can be acquired.

In addition, a derivation with `preferLocalBuild = true` with `max-jobs
= 0` which is not a built-in derivation is not considered suitable for
being possible to build.

Our documentation in `max-jobs` writes:

> `0` is useful when using remote builders to prevent any local builds
(except for preferLocalBuild derivation attribute which executes locally
regardless).

A valid interpretation is that `preferLocalBuild` derivations (all of
them) will always execute even if `max-jobs = 0`.

This CL achieves this promise by enabling `preferLocalBuild = true`
derivations to draw in priority capacity from a `preferLocalBuild`-only
pool and then fall back to the build pool (`maxBuildJobs`).

If there's non-zero max-jobs, we make the `preferLocalBuild`-only pool
empty.

If there's zero max-jobs, we make the `preferLocalBuild`-only pool
non-empty (capacity: 1).

Remark 1: if `max-jobs = 0`, no non-`preferLocalBuild = true`
derivations can be built without a remote builder and `preferLocalBuild
= true` derivations can be built one at a time if `extra-local-jobs` is
not overridden.

Remark 2: if `max-jobs != 0`, no `preferLocalBuild = true` derivations
can bypass capacity limits, i.e. `max-jobs` unless `extra-local-jobs` is
overridden.

Fixes #855.

Change-Id: I00a0acac7375a881aec6281ebb13a4530b26e460
Signed-off-by: Raito Bezarius <raito@lix.systems>
2026-03-02 23:46:38 +01:00
Raito Bezarius bd108b7e61 libutil/config: support optional<uint32_t>
This is going to be used in the extra-local-job future setting.

Change-Id: Ied76f32b8fa97cb71691d76167103001aa14fa01
Signed-off-by: Raito Bezarius <raito@lix.systems>
2026-03-02 20:20:06 +01:00
Raito Bezarius ac6c9a9c0a libfetchers/github: distinguish ref/rev provenance
When ref/rev are very similar looking, e.g. a revision SHA1, the logic
to reconstruct whether we had a ref or rev initially cannot work.

This regression was introduced by
I2c72d5a32e406a7ca308e271730bd0af01c5d18b which passed the information
as an attribute field called `refOrRev`, instead, we pass `ref` or `rev`
but not `refOrRev`.

We apply the same post-processing logic to distinguish rev/ref in
path-style flake references: `github:owner/repo/$refOrRev`.

Fixes #520 #841.

Change-Id: I2b1985cd5f351f43fea84232c1972715e2408fb1
Signed-off-by: Raito Bezarius <raito@lix.systems>
2026-03-02 13:14:42 +00:00
eldritch horrors 6ddc59de47 launch-builder: don't limit sandbox setup data size
the channel we're using is fully trusted, we don't need the traversal limit.

fixes #1121

Change-Id: I2833a7459cec1e2392e8740d8cab213685d3e2b3
2026-03-02 12:10:12 +00:00
skye 9a408cbeb7 libexpr: Replace Value::mkPrimOp with constructor calls
Change-Id: I19b05e260945e237f7856b5d644a43076a6a6964
2026-03-01 18:02:58 -05:00
Raito Bezarius 74300fd0a7 libexpr/primops: reject __json in structured attrs derivations
In structured attrs derivations, __json is used to serialize the `env`
attribute into a JSON object.

If the derivation enables structured attributes AND specify its own
`__json`, one of the field will take precedence (the reader can have fun
by guessing which one).

To reduce underspecification, we disallow `__json` in structured
attributes derivations.

Fixes #380.

Change-Id: I51c3b2af1ff9449471ba81d4c72df6a7a263eef7
Signed-off-by: Raito Bezarius <raito@lix.systems>
2026-03-01 19:05:54 +00:00
skye 12cee5cb22 libcmd/repl: Migrate evalString to return a Value
Change-Id: I41cd79b71106474d048d447befac16676a6a6964
2026-03-01 01:01:47 -05:00
skye 8623dade34 libexpr: Migrate callFlake to return a Value
Change-Id: Ibdac6eb1c9dfda894d783a7b6e333f486a6a6964
2026-03-01 01:01:47 -05:00
skye 2be998eeb4 libexpr: Migrate Evaluator::evalLazily to return a Value
Change-Id: I9f778407d454e141cb9b7959bbc02ed26a6a6964
2026-03-01 01:01:47 -05:00
skye c6b4f30be9 libexpr: Migrate EvalState::autoCallFunction to return a Value
Change-Id: I426c3d413b18848090dd05674a08e5fb6a6a6964
2026-03-01 01:01:47 -05:00
skye 27bf276304 legacy/nix-env: Migrate loadSourceExpr to return a Value
Change-Id: Ia1e1ac6fe9fd00d7a2fa4a39a3ce21e86a6a6964
2026-03-01 00:04:28 -05:00
eldritch horrors 30e9387cf9 testing: migrate path-from-hash-part.sh
Change-Id: Ied00671595d82c6d446f117d6aa9c42a0c758cb6
2026-02-28 22:09:44 +00:00
eldritch horrors 8d389fcccf testing: migrate selfref-gc.sh
Change-Id: Ibead4030448fb9251be78b3c876c7f054154c83c
2026-02-28 22:09:44 +00:00
eldritch horrors f4c92f8872 testing: migrate function-trace.sh
Change-Id: I44bd28165070f55f21b052bc02ba6f2ea5787a1d
2026-02-28 22:09:44 +00:00
eldritch horrors fae0242f69 testing: migrate ssh-relay.sh
Change-Id: I520c8be1c30b4ee7660c8ceeba62a6d0757c337b
2026-02-28 22:09:44 +00:00
eldritch horrors e8cb30b11c testing: fix f2 NIX_BIN_DIR determination from meson
`nix.full_path()` is the *built* path, not the *installed* path. in the
sandbox this point to a location that contains *only* `nix`, not any of
the old-cli symlinks. any test that needs them in path would thus fail.

Change-Id: Ia651db8d1151a84f8d1b52e8993f6db61b0fe104
2026-02-28 22:09:44 +00:00
skye f856d4fd25 libexpr: Migrate EvalState::evalFile to return a Value
Change-Id: I19ce8623477dd96628476b3e3dd58cfd6a6a6964
2026-02-28 15:53:10 -05:00
skye debf5554e0 libexpr: Consolidate implementation between Value string constructors
Change-Id: I5bf8d58b534cd652d89f7b93019378b66a6a6964
2026-02-28 15:53:10 -05:00
skye be3a40e5dc libexpr: Replace Value::mkString with constructor calls
Change-Id: I55bba546eb090728a71734450a2a5f496a6a6964
2026-02-28 15:53:10 -05:00
Tom Hubrecht d52033fc77 nix/develop: Don't ignore SSL_CERT_FILE when its value is meaningful
Change-Id: I31e85a5995edc40ed2e687077ffdf563e717abb4
2026-02-28 12:32:45 +00:00