Commit Graph
19104 Commits
Author SHA1 Message Date
Tom Hubrecht cbeb4fcd69 repl: Fix the use command
The culprit was a space added at the wrong place, which messed with c++
raw strings.

Fixes #1178

Change-Id: Ic1e09cb7215d9a6dd2d13fd92242649b0e1fcd13
2026-04-07 11:02:53 +02:00
Qyriad d0190cff6f improve justfile, and add more docs about it
Change-Id: I00286276dc0ce17a5877a7bd13bb254d6a6a6964
2026-03-28 19:08:37 +01:00
rootile 76499d36ea f2/nix: rename _serialise to _serialise_config
Change-Id: Icaa10bf615ae5fa6d3a3957f74055c9d76f67483
2026-03-28 14:06:26 +01:00
rootile 3bc59b6e0a f2/testlib: fix typechecking for None values
Change-Id: Ie744be23d2b7963d8cd8f80cfeae051249e34d34
2026-03-28 14:06:26 +01:00
blokyk 001e3fde8f docs: add section about overlays in nix repl --help
I just copied and slightly edited the `man nix.conf(5)` docs about
`repl-overlays` to the nix repl help text (but cut out the more
complicated example and redirecting to the nix.conf docs for more
info).

Fixes #303

Change-Id: I85efaef606d8779ac66fe72cd3947d663f33fa44
2026-03-27 10:41:45 +00:00
skye 03ab7b4a76 package.nix: Remove unused linuxPackages input
This input was added in cl/2884, but was unused even then. The
`linuxPackages` within `buildPackages` is used instead.

Change-Id: I71c522ef683aa098eac0b356b22007ba6a6a6964
2026-03-24 11:43:30 -04:00
skye b94d615baa libexpr/json-to-value: Replace add with addValue and define TopLevelJSONValue
Calls to JSONState::add() always followed an assignment to
JSONState::value(), resulting in the new value going through
JSONState::v for no good reason. The only use of `v` outside of a
pointless stepping stone for `add` was to store the final top-level
Value before it is read out by JSONSax::result(), so it really only
makes sense for the top level JSONState to contain Value field.

Change-Id: I1758c7b770eb4b0c122e501b764dd42b6a6a6964
2026-03-23 19:37:27 -04:00
piegames 35b776540f libutil/LinearMap: Expose rbegin and rend functions
Change-Id: I9a4350cc147c98c785b26fbef6c235cd5c48a4cc
2026-03-23 14:47:39 +01:00
piegames d04fcb57fd libexpr: Don't call setName on dynamic attrs
And also document in great detail why this is a wrong thing to do

Change-Id: Ifd1331ee7ee4e05322593ada801bab1c3ea8d349
2026-03-23 14:47:39 +01:00
piegames 93edf577b7 libexpr/eval: Factor out attrs updating code into dedicated helper function
The bytecode evaluator can use it 1:1

Change-Id: I9791a749231fe42e0e534853d3f3cce91913346c
2026-03-23 14:47:39 +01:00
Maximilian Bosch 4960a217fe flake: fix attr-path of build-lowdown_2_0 job in hydra jobs
We would've had `build-lowdown_2_0.aarch64-linux.aarch64-linux`
otherwise. This is a bit of a problem because my way of generating a
list of constituents for Hydra's per-architecture[1] release job stops
recursing once it encounters a system.

The alternative would be to switch `hydraJobs` to `<system>.x.y` or
switching Hydra to "legacy" jobsets. For the latter I'd prefer to do the
same for Buildkite such that we don't have diverging things to build
depending on pre/post-merge CI.

[1] per-architecute because the trusted AFNix builders don't support all
    the architectures we support in Lix and with Flakes there's no way
    of parameterizing the list of supported systems.

Change-Id: I33f31260caf86ed5bb0f728770ca3cf1c00adf31
2026-03-22 12:30:34 +01:00
Maximilian Bosch 0488a0181d libcmd: allow setting nested attributes via --arg/--argstr
Closes #496

When running

    nix-build ../nixpkgs --arg config.allowUnfree true -A hello-unfree

the package `hello-unfree` is now built rather than getting an
eval-error rejecting instantiation. This is because `config.allowUnfree`
is now interpreted as nested attribute-set declaration, similar to how
it's done in `nix repl`.

To prevent sudden breakage, this behavior was carefully deprecated with
Nix throwing an error if the identifier for `--arg` is not a pure
identifier, but an expression as above.

Any kind of merging is rejected. I.e. doing

    nix-build ../nixpkgs --arg config '{cudaSupport = true;}' --arg config.allowUnfree true

is prohibited. That way we don't have to think about merge semantics for
cases like this (or even worse `--arg config 'rec { ... }'`). Another
nice side-effect of this is that we don't need to create an EvalState to
force the values and implement merging.

Change-Id: I8b560883a4468a3f32f915764b08f5fdd8fe71bb
2026-03-21 23:16:30 +01:00
Maximilian Bosch 2a11984a58 libexpr: allow empty attr-names in parseAttrPath if they are quoted
While it doesn't make sense to have `foo..bar`, the attribute-path
`foo."".bar` is valid and shouldn't throw.

Change-Id: Ifcddaad6233c6ba8f17cb5c953c2101d276dfeb6
2026-03-21 23:16:30 +01:00
Maximilian Bosch c5d21b36c5 libcmd: turn autoArgs into a map that points to std::variant
This is a little more elegant and easier to reason about than prefixing
strings with whatever type the rest of the string is.

Change-Id: I7769535303dcb9f67b79e89bef162beec990e2a0
2026-03-21 23:16:29 +01:00
blokyk 66d702d28d libexpr/primops: make break force its argument
previously, `builtins.break` didn't force its argument, resulting in
a value wrapped with `break` being opaque to most builtins if not
also wrapped with `seq`. see [lix-project/lix#1165] for more details
on what this can break.

this tiny fix just adds a call to `forceValue` inside `prim_break`,
but unfortunately this "breaks" a few existing tests because it
changes the call stack; those tests' golden outputs have been adjusted
without modifying their intended purpose.

Fixes #1165

[lix-project/lix#1165]: https://git.lix.systems/lix-project/lix/issues/1165

Change-Id: I5fe4ee3ff28b38aaf924125b8978130812e58fef
2026-03-21 18:38:43 +01:00
Maximilian Bosch af2ef44e76 flake: add release job to Hydra
This job is used to indicate that all relevant Hydra jobs of an
architecture have built. The idea is to build some CD mechanism on
AFNix's Hydra to e.g. auto-update the nightly manual.

See https://hydra.afnix.fr/jobset/lix/demo for the current setup.

Change-Id: I41724c5884a068bbe41407ab30f8edf8e4914001
2026-03-21 13:00:31 +01:00
blokyk daadfed9ae libcmd/repl: allow :st argument to be relative to current stack index
See [lix-project/lix#1156], but basically currently the `:st <n>`
debugger command doesn't allow any negative indices, and putting a plus
sign in front of the arg doesn't change anything; thus, we can exploit
that "design space" to allow users to move between different stack
frames easily, by simply prepending their arg with a +/- sign.

The actual behavior is little more nuanced when you account for errors:
as suggested by @pennae (thanks! :), when the user inputs an offset that
would result in an invalid frame index, the debugger instead clamps it
to the closest bound (i.e. 0 for negative offsets, $maxFrame for
positive ones) and just prints a warning.

Fixes #1156

[lix-project/lix#1156]: https://git.lix.systems/lix-project/lix/issues/1156

Change-Id: I02a0cdb6aaebbdb0515308880a3bf9c0d2fcd25e
2026-03-20 18:22:24 +01:00
skye 774f957599 libexpr/attr-set.hh: Deprecate Attr default constructor
The default constructor of Attr default constructs a Value, which is
itself deprecated. Therefore the default constructor of Attr must
itself be either deprecated in turn or removed. The default can't be
trivially deleted because Bindings::EMPTY depends on the default
constructor of Bindings which depends on Attr's default constructor, so
I'm settling for deprecating it for now.

Part of work towards #744

Change-Id: Ie34b08788780615c5478a0354122530b6a6a6964
2026-03-18 22:03:33 -04:00
skye 83bca23d4a libexpr/primops: Avoid Value default construction in primop_removeAttrs
This makes the removal vector a vector of Symbols instead of Attrs, and
uses a custom Compare to still be able to std::set_difference them.

std::ranges::set_difference **should** be the perfect function for this,
but because for some reason it spuriously requires
`std::indirectly_copyable<I2, Out>`, I can't use it here. This
defficiency has bee recognized before [here](https://github.com/cplusplus/papers/issues/1021),
but no one has driven the fix forward.

Part of #744

Change-Id: I6d2c016ea41e033bf38836f859541b506a6a6964
2026-03-18 22:03:33 -04:00
blokyk 8294cd534b docs: fix indent of builtins and nix.conf descriptions in manual
The manual for the builtins and nix.conf currently has inconsistent
indentation, which causes some of the descriptions to end up being
partially treatedas code blocks in markdown (and thus the manual).

This was simply caused by the template string for the docs having
too much indentation before the description is inserted, so this fixes
that 16-bytes mistake.

Change-Id: Ia264e3b1abb20430109029d07a2d2b0a1a726bd4
2026-03-18 14:33:21 +01:00
blokykandeldritch horrors 6e1e76f10f libcmd/repl: print error for invalid :st argument
currently, the `:st <n>` command in the debugger will simply silently
fail if the argument cannot be converted to an integer, or if it falls
outside the range of valid stack indices. this isn't too big of problem,
but it can be nicer to tell the user something went wrong, rather than
not give them any output and having them guess (esp. in the second case).

this commit adds two errors, one for each case:

  1. the argument is not actually an integer, or is outside INT_MIN/MAX
     -> "argument '%arg' is not a valid integer"

  2. the argument is an integer outside the range of stack traces
     -> "stack index must be between 0 and %max_frame, but was %arg"

Change-Id: I8109feeede79a9ad3db9ee7dc95d37e7dd19741a
2026-03-18 13:15:13 +00:00
sterni f7d7b5d93f libcmd: remove support for lowdown < 1.4.0
NixOS 25.05 which distributed lowdown < 1.4 has been EOL for a bit now,
25.11 ships lowdown 2.0.4.

Dropping support means we can tweak the lowdown options for terminal
output which have been added in 1.4.0 without having diverging behavior
in possible builds of Lix.

Change-Id: Icae97cf5e9e680766b8a6f4e85514f4c4625d1dd
2026-03-17 21:38:42 +00:00
sterni af0390c27b libcmd: add support for lowdown >= 3.0.0
lowdown 3.0.0 merged some flags into one to save on bits and did not add
any aliases for backward compatibility.

As with the changes for lowdown >= 1.4, we define a preprocessor flag to
gate the changes on and add a job to CI to ensure that lowdown < 3.0
keeps working (which is used by NixOS 25.11).

Unfortunately, we need to jump through some hoops to prevent nix and lix
from upstream Nixpkgs from being rebuilt due to a changed lowdown. Since
both implementation's packaging in Nixpkgs has their own package set /
fix point now, we can't simply inherit them from `prev` since they will
always be (re-)computed from the `final` fix point. As a consequence,
we need to expose our changed lowdown version at a non-default attribute
or break the builds of Nixpkgs derivations we test against.

Change-Id: I20a3e2fdaa05906f032ff66911c42867557fdd11
2026-03-17 21:38:35 +00:00
skye cf5e5f599e libexpr/nixexpr: Move backing fields of ExprLiteral subclasses into new
base classes

`ExprLiteral::v` needs to be initialized in ExprLiteral's constructor,
but at the time that it gets initialized subclass fields don't yet exist
so it can't reference them. Previously, `v` was default constructed and
then later assigned a proper value, but this creates a problem when
attempting to remove all default constructions of `Value` from the
codebase. This commit moves the backing fields of each of the subclasses
into new base classes, which exist just to make sure they get
initialized before the `ExprLiteral` base class.

Work towards #744

Change-Id: Ic6d24cab474460b113f2fbcc8d92ad266a6a6964
2026-03-17 15:48:12 -04:00
skye 51c6d6a2e8 libexpr: Remove various default constructions of Values
Progress towards #744

Change-Id: I138ecf7ab712ea570ecbf506c7b6f6be6a6a6964
2026-03-17 15:48:12 -04:00
skye 8b99b75698 libexpr: Push Values onto vectors instead of default constructing
ahead of time

Rather than creating fixed size vectors of default constructed Values
before assigning to those elements, reserve the desired capacity and
then push created values onto the vector. This avoids default
constructing any Values.

Part of fixing #744

Change-Id: I36eff4275a893b181eaf3ce145b1ee446a6a6964
2026-03-17 15:48:12 -04:00
skye 179164cffc libexpr: Migrate EvalState::mkPos to return a Value
Part of #1136 and progress towards #744

Change-Id: I31d0169077954ea82c9c7d341afdccd76a6a6964
2026-03-17 15:48:12 -04:00
skye 810a3bad11 libexpr: replace BindingsBuilder::alloc with insert
Progress towards #744
`alloc` default constructed a `Value` which is a problem because the
defaut constructor of `Value` is deprecated

Change-Id: I789cba20bd98728758395080a3a9cf6e6a6a6964
2026-03-17 15:48:12 -04:00
skye f0891b440f libexpr/primops/fromTOML: Migrate visit lambda to return a value
Necessary step to replace BindingsBuilder::alloc uses with insert

Arguably part of #1136

Change-Id: I72acdd1676cf2dda69bce39e9b7feb656a6a6964
2026-03-17 15:48:12 -04:00
skye 570357c733 libexpr: Replace Value::mkNull with Value::VNULL
A small step towards fixing #744

Change-Id: If8304d4de20bae07b33eb7825f781e0f6a6a6964
2026-03-17 15:48:12 -04:00
Yurekaandeldritch horrors 96db7c79cf lix-doc: remove rust_dynamic_args
This causes a build error with lto, and according to Jade is not
strictly needed anymore.

Change-Id: I41e53a57f40711061effe08f78545011a4b51754
2026-03-17 15:10:18 +01:00
eldritch horrors 022e43aa7f fix the static build
- launch-builder-linux.cc was missing an include for musl
  and used function that are not defined in the launchers
- musl caches pids used for raise, breaking sandbox setup
- the mtls contrib plugin won't build, didn't try fixing,
  static builds can't really use plugins reliably anyway.

Change-Id: I5ab1664e45ea977e5bcf05e41d825e6014e62146
2026-03-17 14:24:13 +01:00
Linus Heckemann f87d753987 libexpr: print flake config warning to stderr
Fixes #1155

Change-Id: Ie63f9200f7c06b1eec6c52518d6f523f6a6a6964
2026-03-17 07:10:00 +00:00
piegames 35b46d1fcb libexpr/value: Add constants for the empty set and null
Change-Id: I4b673cbb81b06f1c415a0059cf1238d2d329725e
2026-03-16 22:21:35 +01:00
piegames 3c0fcf6836 libutil/chunked-vector: Add default constructor
Change-Id: I75a2d0daac7ddddbe4bb3791f642e15cfbe5f732
2026-03-16 22:21:35 +01:00
rootile bcc9350bfe tests/functional2: migrate simple.sh
Change-Id: I4366ce7d877935df98e35d733650c60f59478ace
2026-03-16 16:52:14 +00:00
skye c452341b39 libexpr: Replace Value::mkExternal with constructor call
Change-Id: I7f92a91f6510be8948dfe0765b3fec6f6a6a6964
2026-03-14 13:55:59 -04:00
skye 3c9f42443e libexpr: Migrate mkStorePathString to return a Value
part of #1136

Change-Id: I32ba0f8ef369a82ceb8f75816a2ce6dc6a6a6964
2026-03-14 13:55:59 -04:00
skye 72a456210e libexpr: Migrate makePositionThunks to return Value tuple
part of #1136 and a step towards #744

Change-Id: Ib2ccea4c098bbb66eaa47645b6fa59e56a6a6964
2026-03-14 13:55:59 -04:00
skye 3a18ed52e2 libexpr: Migrate EvalState::mkOutputString to return a Value
part of #1136 and a small step toward resolving #744

Change-Id: I4e1602b37c40517a92cbab8fe4074d7e6a6a6964
2026-03-14 13:55:59 -04:00
sternenseemann b72f5e9f9d flake: remove nixUnstable attr which has been removed upstream
Change-Id: I869941c998daa50d4deb0e4ef9740d10919e0d82
2026-03-14 14:04:12 +01:00
Jade Lovelaceandeldritch horrors 2cea406121 version.json: begin the 2.96 series
Change-Id: I21c37e20fc2e5786367aa9b6e5ebb7ba12eb8b6c
2026-03-13 22:59:53 +01:00
Jade Lovelace c08f2336d0 release: merge release 2.95.0 back to mainline
This merge commit returns to the previous state prior to the release but leaves the tag in the branch history.
Release created with releng/create_release.xsh

Change-Id: Ia7a63807681389cf5ccb9d07539b880697a88be5
2026-03-13 09:06:50 -07:00
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