Commit Graph

19809 Commits

Author SHA1 Message Date
Jörg Thalheim
89ba6dff66
Merge pull request #13032 from obsidiansystems/more-outputs-test
Improve derivation "advanced attrs" test, fix almost-bug
2025-04-15 19:08:35 +02:00
Jörg Thalheim
009ff8e5a7
Merge pull request #13013 from NaN-git/fix-ceil-floor
libexpr: fix UB in builtins.ceil and builtins.floor
2025-04-15 18:56:46 +02:00
Jörg Thalheim
cf6da9234c
Merge pull request #12410 from obsidiansystems/derivation-options-2
Scrap `ParsedDerivation` for parts
2025-04-15 18:36:11 +02:00
John Ericson
32409dd7d7 Remove stray assignment side affect in lambda
This was almost a bug! It wasn't simply because another assignment would
clobber it later.
2025-04-15 12:29:17 -04:00
John Ericson
a0b2b75f59 Derivation "advanced attrs" test: Ensure fields are set to distinct values
We had fields set to the same values before in our test data. This is
not a problem per-se, but does mean we wouldn't catch certain mixups.
Now, the fields are set to distinct values (where possible), which makes
the test more robust.
2025-04-15 12:29:14 -04:00
Jörg Thalheim
99a16c5203
Merge pull request #13026 from roberth/issue-13018
Fix issue #13018, `sourceInfo` strict in `outputs`
2025-04-15 13:51:02 +02:00
Jörg Thalheim
22c928f9c0
Merge pull request #12992 from DeterminateSystems/input-cache
Rename FlakeCache to InputCache and move it to libfetchers
2025-04-15 13:32:39 +02:00
Jörg Thalheim
13a0853f04
Merge pull request #13024 from obsidiansystems/derivation-options-exportReferencesGraph
Move `exportReferencesGraph` to `DerivationOptions`
2025-04-15 13:28:00 +02:00
Jörg Thalheim
995d4f4aa7
Merge pull request #13022 from obsidiansystems/derivation-options
Test derivation options with content-addressing too
2025-04-15 13:27:09 +02:00
Robert Hensing
2109a5a206 fix: Evaluate flake parent source without evaluating its outputs
This requires that we refer to the `sourceInfo` instead of the
`result`. However, `sourceInfo` does not create a chain of basedir
resolution, so we add that back with `flakeDir`.
2025-04-15 13:22:53 +02:00
Robert Hensing
9de9410f29 call-flake.nix: allNodes.${key} -> allNodes.${key}.result 2025-04-15 13:22:53 +02:00
Robert Hensing
674375b021 call-flake.nix: refactor: Bring mapAttrs into scope 2025-04-15 13:22:53 +02:00
John Ericson
d8be4f618f Scrap ParsedDerivation for parts
Only a much smaller `StructuredAttrs` remains, the rest is is now moved
to `DerivationOptions`.

This gets us quite close to `std::optional<StructuredAttrs>` and
`DerivationOptions` being included in `Derivation` as fields.
2025-04-14 16:14:41 -04:00
John Ericson
1e31b60043 Limit ParsedDerivation just to the derivation's environment
This moves us towards getting rid of `ParsedDerivation` and just having
`DerivationOptions`.

Co-Authored-By: HaeNoe <git@haenoe.party>
2025-04-14 15:46:55 -04:00
John Ericson
d285b80033 Move exportReferencesGraph to DerivationOptions
Tests are updated accordingly.
2025-04-14 14:24:36 -04:00
John Ericson
307dbe9914 Test derivation options with content-addressing too
Now, both the unit and functional tests relating to derivation options
are tested both ways -- with input addressing and content-addressing
derivations.
2025-04-14 13:43:46 -04:00
John Ericson
7acc229c8f Use the same variable for content addressing in functional tests
`CONTENT_ADDRESSED` -> `NIX_TESTS_CA_BY_DEFAULT`
2025-04-14 11:20:07 -04:00
Eelco Dolstra
b3aa07009d
Merge pull request #13019 from NixOS/mention-blake3
Mention BLAKE3 in the Nix 2.27 release notes
2025-04-14 15:47:38 +02:00
Eelco Dolstra
c0ed07755a Mention BLAKE3 in the Nix 2.27 release notes 2025-04-14 15:18:29 +02:00
Eelco Dolstra
4966217b6a Move the InputCache to EvalState 2025-04-14 14:29:14 +02:00
mergify[bot]
b1fe93fab7
Merge pull request #13015 from obsidiansystems/derivation-options
`ParsedDerivation`: don't take `drvPath`
2025-04-14 11:14:34 +00:00
Jörg Thalheim
3f3fd2c94b
Merge pull request #12976 from picnoir/pic/multisign
store URI: introduce multiple signatures support
2025-04-14 11:20:41 +02:00
Picnoir
7ea536fe84 Narinfo sign: multiple signatures variant
This is a small optimization used when we're signing a narinfo for
multiple keys in one go. Using this sign variant, we only compute the
NAR fingerprint once, then sign it with all the keys.
2025-04-14 10:30:47 +02:00
John Ericson
0123640009 ParsedDerivation: don't take drvPath
It is just use for adding context to errors, but we have `addTrace` to
do that. Let the callers do that instead.

The callers doing so is a bit duplicated, yes, but this will get better
once `DerivationOptions` is included in `Derivation`.
2025-04-13 18:21:13 -04:00
Philipp Otterbein
56d37656ac libexpr: fix UB in builtins.ceil and builtins.floor
tighten and fix specification of both builtins
2025-04-13 04:36:09 +02:00
mergify[bot]
0e1323c041
Merge pull request #13009 from anthowan/patch-1
Fix typo in string context docs
2025-04-12 23:57:57 +00:00
Anthony Wang
f64b8957c7
Fix typo in string context docs 2025-04-12 19:17:27 -04:00
Jörg Thalheim
71567373b6
Merge pull request #13008 from Mic92/aliases
Move alias support from NixArgs to MultiCommand + test
2025-04-12 11:06:09 +02:00
Jörg Thalheim
b1b75e1d7a tests/functional: add test for alias commands 2025-04-12 10:20:30 +02:00
Jörg Thalheim
837f349a99
Merge pull request #12999 from fricklerhandwerk/language
Nix language reference: highlight characteristic features
2025-04-12 10:13:47 +02:00
Jörg Thalheim
3094e39dc4
Merge pull request #12646 from whatsthecraic/feature/s3-auth-iam-role
S3: opt-in the STSProfileCredentialsProvider
2025-04-12 00:30:22 +02:00
Dean De Leo
51073607ea S3: opt-in the STSProfileCredentialsProvider
The STSProfileCredentialsProviders allows to assume a specific IAM role
when accessing an S3 repository. Sometimes this is needed to obtain the
permissions to operate on the bucket.
2025-04-11 23:47:56 +02:00
Jörg Thalheim
a46ca4f02f
Merge pull request #12538 from NaN-git/fix-s3-progress
libstore S3: fix progress bar and make file transfers interruptible
2025-04-11 23:44:53 +02:00
Philipp Otterbein
49f757c24a add isInterrupted() call and replace some checkInterrupt() occurrences 2025-04-11 22:48:10 +02:00
Philipp Otterbein
db297d3dda libstore: same progress bar behavior for PUT and POST requests
- no differentiation between uploads and downloads in CLI
2025-04-11 22:48:10 +02:00
Philipp Otterbein
9da01e69f9 libstore S3: fix progress bar and make file transfers interruptible 2025-04-11 22:48:10 +02:00
Robert Hensing
bbfe39ef27
Merge pull request #12995 from fricklerhandwerk/link-building
glossary: link "building" from "realisation"
2025-04-11 00:15:12 +02:00
Robert Hensing
7a0e38a1aa
Merge pull request #12998 from fricklerhandwerk/packages
glossary: refine the definition of "package"
2025-04-11 00:14:23 +02:00
Valentin Gagarin
bf65bc7eb7 Nix language reference: highlight characteristic features
Nix shipping with Yet Another Programming Language is often questioned
among beginners. This change highlights distinctive aspects of the Nix
language to ease the learning curve and better orient readers around
what really matters for using Nix.

Since it's on topic, this change also polishes the wording on the motivation for string contexts.
2025-04-10 23:50:55 +02:00
Valentin Gagarin
a0d3003bf2 glossary: refine the definition of "package"
This change follows the definition from aptitude, but using precise notions from Nix:

> package managers deal with packages: collections of files that are
> bundled together and can be installed and removed as a group.
> [...]
> If a package A depends upon another package B, then B is required
> for A to operate properly.
> [...]
> The job of a package manager is to present an interface which assists
> the user in managing the collection of packages installed on his or her system.
>
> -- <https://www.debian.org/doc/manuals/aptitude/pr01s02.en.html>

An interesting addition:

> Packages are abstractions defining the granularity at which users can act
> (add, remove, upgrade, etc.) on available software.
> A distribution is a collection of packages maintained (hopefully) coherently.
>
> -- Package Upgrades in FOSS Distributions: Details and Challenges
>    (Roberto Di Cosmo, Stefano Zacchiroli; 2009) <https://arxiv.org/pdf/0902.1610>

Notably these quotes and this change don't say anything about installation,
or what it means for software to be available. In practice, this is
handled downstream, e.g. in NixOS or Home Manager. Nix historically
provides rudimentary facilities for package management such as
`nix-env`, but I claim they are widely agreed upon being discouraged,
with plenty of arguments provided in <https://stop-using-nix-env.privatevoid.net>.

Similarly, the specific structure of packages is determined downstream,
since Nix is policy-free:

> Nix is policy-free; it provides mechanisms to implement various deployment policies, but does not enforce a specific one.
>
> -- The Purely Functional Software Deployment Model (Eelco Dolstra; 2006) <https://edolstra.github.io/pubs/phd-thesis.pdf>

Specifically, Nix mechanisms do not define what a package is supposed to be:

> It's worth noting that the Nix language is intended as a DSL for package and configuration management, but it has no notions of "packages" or "configurations".
>
> -- <https://gist.github.com/edolstra/29ce9d8ea399b703a7023073b0dbc00d>

This is why we say, Nix *allows* denoting packages in a certain way, but
doesn't enforce any particular way.
2025-04-10 22:50:28 +02:00
Eelco Dolstra
6cd2b4e169 Move alias support from NixArgs to MultiCommand
This allows subcommands to declare aliases, e.g. `nix store ping` is
now a proper alias of `nix store info`.
2025-04-10 19:48:55 +02:00
Valentin Gagarin
fc5b1d2344 glossary: link "building" from "realisation" 2025-04-10 16:56:19 +02:00
Eelco Dolstra
e3042f10af Move getAccessorCached() to InputCache 2025-04-10 10:24:15 +02:00
Eelco Dolstra
012453d1e6 Move the input cache into libfetchers 2025-04-10 10:24:15 +02:00
Eelco Dolstra
c7f8147282 Rename FlakeCache -> InputCache and key it on Inputs instead of FlakeRefs 2025-04-10 10:24:15 +02:00
Eelco Dolstra
3f3cc6f438
Merge pull request #12991 from Mic92/cgroup
linux/cgroup: delete double quote in error message
2025-04-10 10:11:24 +02:00
Eelco Dolstra
26cb166bca
Merge pull request #12531 from obsidiansystems/store-accessor-root
`Store::getFSAccessor`: Do not include the store dir
2025-04-10 09:55:03 +02:00
Jörg Thalheim
b3f80283a6 linux/cgroup: delete double quote in error message 2025-04-10 09:31:48 +02:00
Eelco Dolstra
9d3595646d nix shell: Resolve symlinks in storeFS
`storeFS` is the `MountedSourceAccessor` that wraps `store->getFSAccessor()`.
2025-04-09 17:34:19 -04:00
John Ericson
eb643d034f Store::getFSAccessor: Do not include the store dir
Rather than "mounting" the store inside an empty virtual filesystem,
just return the store as a virtual filesystem. This is more modular.

(FWIW, it also supports two long term hopes of mind:

1. More capability-based Nix language mode. I dream of a "super pure
   eval" where you can only use relative path literals (See #8738), and
   any `fetchTree`-fetched stuff + the store are all disjoint (none is
   mounted in another) file systems.

2. Windows, where the store dir may include drive letters, etc., and is
   thus unsuitable to be the prefix of any `CanonPath`s.

)

Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2025-04-09 17:34:18 -04:00