1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-19 10:50:24 -04:00
Commit graph

2428 commits

Author SHA1 Message Date
Robert Hensing a92eb5fc33 doc/manual: Add C API to menu 2024-04-24 20:04:18 +02:00
Valentin Gagarin 5747d244ed
streamline macOS uninstall instructions (#10589)
* move single-user uninstall to the end

this is not the default method of installation, and therefore irrelevant
for most users.

* move the backup restore instructions to the first step

for most users we can expect that the system-wide shell init files were
not ever touched, so we can as well tell them to do the most likely
thing.

from experience, while it's not necessarily safe to just mess with these
files, most people are simply confused by the complexity of
instructions.

* provide more detailed instructions for using `sudo vifs`

we can expect most beginners not to ever have used `vi`, and they will
probably need some hand-holding.

* express instructions as a script

Co-authored-by: wamirez <wamirez@protonmail.com>
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2024-04-24 15:04:49 +00:00
Eelco Dolstra b219017b88 Typo 2024-04-23 10:21:45 +02:00
Eelco Dolstra 34c5346e98 release notes: 2.22.0 2024-04-23 10:19:32 +02:00
Eelco Dolstra e1fd0e0a8c
Merge pull request #10581 from bam80/patch-3
Update uninstall.md: mention .profile
2024-04-22 11:33:58 +02:00
Eelco Dolstra 16669ae445
Update doc/manual/src/installation/uninstall.md 2024-04-22 11:00:09 +02:00
Andrey Butirsky a6d08e3502
Update uninstall.md: remove ~/.nix-* files also 2024-04-21 17:08:37 +03:00
Andrey Butirsky d4b44a41fb
Update uninstall.md: mention .profile
~/.profile is auto-edited by the single-mode installer so we should mention it in the uninstall instructions
2024-04-21 16:46:03 +03:00
Andrey Butirsky 722dfe9908
Update installing-binary.md: give TTY to the installer
Run the installer with TTY so the process can go interactively
2024-04-21 16:24:09 +03:00
Robert Hensing c6526fa33b
Merge pull request #10563 from hercules-ci/doc-glossary-base-directory
doc/glossary: Add base directory
2024-04-21 15:17:16 +02:00
Robert Hensing e8d267ad5b doc/values: Refer to base directory 2024-04-21 14:24:33 +02:00
Robert Hensing 73125e46fc doc/glossary: Add base directory 2024-04-21 14:24:33 +02:00
Robert Hensing b5f1d4cce9 Edit docs 2024-04-21 14:16:46 +02:00
Robert Hensing 5b36ee4c95 Add pre-commit hook and make format target
I've added the new local.mk to the package sources. While this
should not be needed for the build, it is the simplest solution,
and won't cause many extra rebuilds, because the file won't change
very often.
2024-04-21 13:54:34 +02:00
Robert Hensing 8c4c2156bd
doc/glossary: Define output closure (#8311) 2024-04-19 15:48:56 +02:00
0x4A6F e3fa7c38d7
system: build for riscv64-unknown-linux-gnu (#10228)
* system: add support for riscv64-unknown-linux-gnu

* maintainers: upload riscv64-linux-gnu

* doc: add riscv64-linux to supported platforms
2024-04-18 11:10:52 +00:00
José Luis Lafuente 1f1cd97c71
C API: Add section in Nix manual (#10519) 2024-04-17 15:21:17 +02:00
Eelco Dolstra 75687844e1
Merge pull request #10518 from crayor1/patch-1
Double word is superfluous
2024-04-16 18:07:57 +02:00
Eelco Dolstra 28e0f0a04c
Fix another typo 2024-04-16 17:43:17 +02:00
crayor1 548a12c1fe
Fix typo in hacking.md 2024-04-16 15:54:45 +02:00
crayor1 25265a9365
Double word is superfluous 2024-04-16 14:36:41 +02:00
John Ericson 95ae12b607 docs: Refer to the glossary with @docroot@ instead of ..
These unweildy relative paths probably predate the `@docroot@`
mechanism.
2024-04-12 11:46:47 -04:00
Nikhil Dhiman 19c8867d2a
Fix store-path.md (#10457)
Co-authored-by: John Ericson <git@JohnEricson.me>
Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
2024-04-10 21:11:57 +00:00
John Ericson 021488497d
Merge pull request #10464 from obsidiansystems/nar-format-docs
Document the Nix Archive format
2024-04-10 16:26:27 -04:00
John Ericson 3e5797e97f Document the Nix Archive format
This is adopted from Eelco's PhD thesis.
2024-04-10 15:21:22 -04:00
Maximilian Bosch 50557adb3b
doc/rl-2.20: clarify builders-use-substitutes vs. substitute-on-destination
...as this lead to confusion before.
2024-04-10 17:26:58 +02:00
Théophane Hufschmitt 65d711351e
Merge pull request #10449 from Ma27/rl-2.20-nix-copy-ssh-ng
doc/rl-2.20: add missing entry about `nix copy --to ssh-ng://...`
2024-04-10 11:44:31 +02:00
John Ericson 93d68e18e5 Make outputHashAlgo accept "nar", stay in sync
Now that we have a few things identifying content address methods by
name, we should be consistent about it.

Move up the `parseHashAlgoOpt` for tidiness too.

Discussed this change for consistency's sake as part of #8876

Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2024-04-09 16:17:23 -04:00
Maximilian Bosch f34b8de5b2
doc/rl-2.20: add missing entry about nix copy --to ssh-ng://...
This requires `--substitute-on-destination` if you want the remote side
to substitute instead of copying if possible.

For completeness sake, document it here.

Also, the stable Nix from nixpkgs is still 2.18, so more folks may
stumble upon this when this is bumped, so I'd expect this to be actually
useful.

Closes #10182
2024-04-09 21:27:00 +02:00
Eelco Dolstra 62f8d8c9a9
Merge pull request #10288 from tweag/refine-release-cycle
Update the release cycle
2024-04-05 13:07:31 +02:00
Valentin Gagarin 59597628cb
show Nix logo in the manual (#9870)
* show Nix logo in the manual

the location of files is hard-coded by mdBook.
there is also seems to be no way to define custom templates, therefore
all styling has to be done in the CSS override.

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2024-04-03 14:22:47 +00:00
Théophane Hufschmitt b72e1c79da
Merge pull request #10299 from detroyejr/remove-repl-flake
flakes: remove experimental repl-flake
2024-03-29 15:06:23 +01:00
Jonathan De Troye a09d0e19c1
flakes: Reword doc/manual/rl-next/remove-repl-flake.md
Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
2024-03-29 08:57:41 -04:00
Robert Hensing c0b6907ccd
doc/local.mk: Add manual-html-open phony target for auto-opening the browser (#10308) 2024-03-27 22:28:05 +01:00
vac (Brendan) 37f8edce99
docs: add cacert in macos multi-user upgrade (#10237) 2024-03-27 22:26:50 +01:00
Théophane Hufschmitt 45001c332d
Remove accidental duplicate 2024-03-25 10:48:22 +01:00
Théophane Hufschmitt f78161bb8e
Adress feedback from the PR
Trim down the proposal quite a bit, making it much closer to the previous text, just more explicit about what we support.
2024-03-25 10:47:19 +01:00
Robert Hensing fbf493758c doc/language: Link to nix.dev introduction
Closes #10283
2024-03-24 02:08:28 +01:00
detroyejr 50885b81c9 fix: correct remove-repl-flake.md 2024-03-23 06:31:49 -04:00
Théophane Hufschmitt 38ba96d7b0
Merge pull request #10296 from picnoir/pic/doc-lsp
Doc: explicitly specify which shell to use to get clangd
2024-03-23 08:46:13 +01:00
detroyejr c625b45357 flakes: add remove-repl-flake.md note 2024-03-22 21:39:48 -04:00
Picnoir cc29d85d06 Doc: explicitly specify which shell to use to get clangd
I was using by mistake the .#nix-clangStdenv shell to retrieve clangd.
This clangd is unusable with the project and constantly segfaults.
Let's explicitly state which shell the user should use in the docs.

I don't really understand the source of this segfault. I assume it's
related to a clang version incompatibility. (16.0.6 for
.#nix-clangStdenv 14.0.6 for .#native-clangStdenvPackages)
2024-03-22 22:36:55 +01:00
Tharun T 4e2f11b692 doc build output correction
Signed-off-by: Tharun T <tharun242424@gmail.com>
2024-03-22 18:34:55 +05:30
Théophane Hufschmitt c13a31f639 Update the release cycle
- Align the “frequent” release cycle with the calendar
  - The 6-month release cycle is hard to keep track of. A monthly
    release will make it much easier to remember the release date.
- Officialise the support for a stable version maintained for as long as NixOS stable
  - This is already the case in practice, it just happens that the
    “stable” Nixpkgs version is whichever version was deemed
    stable-enough at the time of the NixOS release.
    Officialise that by cutting a new major release alongside each NixOS one.

Note that this breaks whatever semver compatibility Nix might pretend to
have, but I don't think it makes sense any way.
2024-03-22 11:40:29 +01:00
Théophane Hufschmitt d0824f661e Document the new compile_commands.json target 2024-03-21 16:54:28 +01:00
Eelco Dolstra 650161b7ae
Merge pull request #10242 from fricklerhandwerk/fix-index-redirects
adjust anchor redirects to point to new pages
2024-03-15 18:12:50 +01:00
Daniel Sidhion 49e9efeaaa
doc: document SRI hash format for outputHash (#10230) 2024-03-15 07:09:47 +01:00
Valentin Gagarin 3754614b9c adjust anchor redirects to point to new pages
a previous moving of files accounted for server-side redirects, but not
client-side redirects.
2024-03-14 15:01:47 +01:00
tomberek 25bf671015
Merge pull request #10200 from 9999years/fix-nix-eval-for-derivations
Fix `nix eval nixpkgs#bash` segfault
2024-03-11 13:56:49 -04:00
Rebecca Turner 7f45b1c8d8
Add release note 2024-03-11 10:03:01 -07:00
Eelco Dolstra 4c97a66b4c Tweak release notes 2024-03-11 18:00:10 +01:00
Eelco Dolstra b12dc76cfc release notes: 2.21.0 2024-03-11 16:22:29 +01:00
tomberek a200ee6bf7
Merge pull request #9874 from pennae/error-reports
improve error reports somewhat
2024-03-08 10:51:14 -05:00
Eelco Dolstra ae2bd460a8
Merge pull request #10166 from bobvanderlinden/profile-regex-all
profile: introduce --regex and --all
2024-03-08 15:59:24 +01:00
Jonathan Dickinson 1ffcbddf62
docs: add inherit to language overview (#10194)
* docs: add inherit to language overview

Adds a short summary about `inherit` to the language overview.
2024-03-08 14:24:44 +00:00
Bob van der Linden 4741d3e308
add release note 2024-03-07 21:07:03 +01:00
Eelco Dolstra da62528487
Merge pull request from GHSA-2ffj-w4mj-pg37
Copy built outputs
2024-03-07 11:56:24 +01:00
Eelco Dolstra 454456209f
Merge pull request #10165 from link2xt/patch-1
Make search.nixos.org link in quick start clickable
2024-03-07 11:05:48 +01:00
Robert Hensing e4500e539e doc/glossary: Fix file system object anchor
It was stealing the store object id. Browsers pick the first one.
It was confusing.
2024-03-07 00:04:30 +01:00
pennae 1edd6fada5 report inherit attr errors at the duplicate name
previously we reported the error at the beginning of the binding
block (for plain inherits) or the beginning of the attr list (for
inherit-from), effectively hiding where exactly the error happened.

this also carries over to runtime positions of attributes in sets as
reported by unsafeGetAttrPos. we're not worried about this changing
observable eval behavior because it *is* marked unsafe, and the new
behavior is much more useful.
2024-03-06 23:11:12 +01:00
pennae 4147ecfb1c normalize formal order on ExprLambda::show
we already normalize attr order to lexicographic, doing the same for
formals makes sense. doubly so because the order of formals would
otherwise depend on the context of the expression, which is not quite as
useful as one might expect.
2024-03-06 23:11:12 +01:00
link2xt fe13d4a6e0
Make search.nixos.org link in quick start clickable 2024-03-06 21:55:02 +00:00
Rebecca Turner 4ee5433919
Add release note 2024-03-04 09:24:56 -08:00
Eelco Dolstra e6b9432542 Add release note 2024-03-04 12:48:21 +01:00
Théophane Hufschmitt cd9baa1809 Add release notes 2024-03-01 09:39:50 +01:00
tomberek ffe67c86a8
Merge pull request #9915 from 9999years/evaluating-attribute-position
Add position information to `while evaluating the attribute` errors in the debugger
2024-02-28 18:11:07 -05:00
DavHau 358c26fd13 fetchTree: shallow git fetching by default
Motivation:
make git fetching more efficient for most repos by default
2024-02-28 13:27:22 +07:00
John Ericson 201551c937 Add Git object hashing to the store layer
Part of RFC 133

Extracted from our old IPFS branches.

Co-Authored-By: Matthew Bauer <mjbauer95@gmail.com>
Co-Authored-By: Carlo Nucera <carlo.nucera@protonmail.com>
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
Co-authored-by: Florian Klink <flokli@flokli.de>
2024-02-27 11:27:34 -05:00
Robert Hensing 4c7f0ef6ca
Merge pull request #9847 from pennae/inherit-from-dedup
deduplicate inherit-from source expr work
2024-02-26 20:25:58 +01:00
pennae cefd0302b5 evaluate inherit (from) exprs only once per directive
desugaring inherit-from to syntactic duplication of the source expr also
duplicates side effects of the source expr (such as trace calls) and
expensive computations (such as derivationStrict).
2024-02-26 19:07:08 +01:00
Théophane Hufschmitt 774e7ca584
Merge pull request #9914 from 9999years/debugger-on-trace
Enter debugger on `builtins.trace` with an option
2024-02-21 18:32:56 +01:00
Théophane Hufschmitt 36fa8b1bcc
Merge pull request #9943 from 9999years/release-notes
Add release notes
2024-02-21 18:17:50 +01:00
Rebecca Turner b111fba8cd
Add documentation, rename to debugger-on-trace 2024-02-21 09:07:39 -08:00
Théophane Hufschmitt bc9471d032
Merge pull request #9966 from NixOS/mention-OPTIMIZE-in-hacking-guide
Mention `OPTIMIZE=0` more prominently in the hacking guide
2024-02-15 09:33:15 +01:00
Rebecca Turner 6d2b446e2b
Add release notes for "Pretty print values in nix repl" 2024-02-14 08:58:54 -08:00
John Ericson ef0b82a267
Merge pull request #9986 from nbelakovski/patch-1
Add a note about lists values.md
2024-02-13 17:10:32 -05:00
John Ericson f49efb32fb
Merge pull request #10005 from fricklerhandwerk/local-store-glossary
update glossary entry on store types
2024-02-13 10:45:36 -05:00
Valentin Gagarin f27205f743 redirect local and chroot store to main page 2024-02-13 16:25:07 +01:00
Valentin Gagarin 5b69409f6b only refer to the local store page 2024-02-13 16:08:44 +01:00
Valentin Gagarin fd82ba0985
extract reference documentation on remote builds (#9526)
- move all reference documentation to the `builders` configuration setting
- reword documentation on machine specification, add examples
- disable showing the default value, as it rendered as `@/dummy/machines`, which is wrong
- highlight the examples
- link to the configuration docs for distributed builds
- builder -> build machine

Co-authored-by: Janik H <janik@aq0.de>
2024-02-13 14:13:56 +01:00
Valentin Gagarin ce19338f9f update glossary entry on store types
the interesting information is on the proper pages, and is now presented
a bit more prominently.

the paragraph was a bit confusing to read, also because an anchor link
to an inline definition was in the middle of the sentence. "local store"
now has its own glossary entry.
2024-02-13 13:30:17 +01:00
John Ericson f29d2a9d11 Small EBNF fix 2024-02-12 12:30:28 -05:00
John Ericson 898fd1e48d
Update doc/manual/src/protocols/store-path.md 2024-02-12 12:04:37 -05:00
John Ericson 5169f5f4d9
Apply suggestions from code review
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2024-02-12 12:01:54 -05:00
John Ericson c873a140d7
Apply suggestions from code review
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2024-02-12 11:34:54 -05:00
John Ericson 4c3e4d6d71 Sections, EBNF tweaks 2024-02-12 11:33:06 -05:00
John Ericson 0862d7ce57 Move around non-terminals 2024-02-12 11:26:08 -05:00
John Ericson eb76b35efa Merge remote-tracking branch 'upstream/master' into store-path-complete-construction 2024-02-12 11:22:54 -05:00
John Ericson 30f6b0f9c5 pre -> fingerprint in store path grammar
As suggested by @roberth in
https://github.com/NixOS/nix/pull/9295#discussion_r1486402040.

Thanks!
2024-02-12 11:22:08 -05:00
John Ericson 95190e68ed Mention the use of Extended Backus–Naur form 2024-02-12 11:21:54 -05:00
John Ericson ac1301ddfd Convert store path "grammar" to EBNF 2024-02-12 11:16:53 -05:00
John Ericson 91557df4a7
Apply suggestions from code review
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2024-02-12 11:16:12 -05:00
nbelakovski 4496a4537b
Update values.md
Link to elemAt
2024-02-11 22:52:49 -08:00
nbelakovski f298159a2b
Add a note about lists values.md
There's probably more that can be said, but I thought it might be helpful to put something here about how to access elements of a list for folks coming from more or less any other programming language. If this is rarely used, it might be nice to add to the documentation something about why it's rarely used.
2024-02-10 18:52:39 -08:00
BOHverkill 53eecae525
Fix link to derivation in string interpolation doc
The reference link definition for it pointing to the glossary was
removed, so it is currently not displayed as a link.
2024-02-10 17:27:16 +01:00
Valentin Gagarin 60045f9c96 add clickable anchor links
how the different invocations relate to each other seems be
confusing, which is relatable because one has to wire it up in your head
while reading. an explicit reference should make it unambiguous and
easier to notice due to links being highlighted.
2024-02-09 10:41:03 +01:00
Rebecca Turner 4440eb54e7
Add release note 2024-02-08 12:07:38 -08:00
Rebecca Turner 0f1269243b
Revert "Add release notes for "Stack traces are more compact""
This reverts commit b2868acbdc.
2024-02-08 10:09:47 -08:00
Rebecca Turner b2868acbdc
Add release notes for "Stack traces are more compact" 2024-02-08 10:08:48 -08:00
Rebecca Turner 7f8960d0f2
Add release notes for "Stack size is increased on macOS" 2024-02-08 10:08:48 -08:00
Rebecca Turner 837c350bcd
Add release notes for "Cycle detection in nix repl is simpler and more reliable" 2024-02-08 10:08:48 -08:00
Rebecca Turner 4f0d43a397
Add release notes for "nix repl now respects Ctrl-C while printing values" 2024-02-08 10:08:48 -08:00
Rebecca Turner 24cdb81bb0
Add release notes for "Nix commands respect Ctrl-C" 2024-02-08 10:08:48 -08:00
Rebecca Turner abb5fef355
Add release notes for "Functions are printed with more detail" 2024-02-08 10:08:48 -08:00
Rebecca Turner 9a5d52262f
Add release notes for "Nix no longer attempts to git add files that are .gitignored" 2024-02-08 10:08:48 -08:00
Rebecca Turner 754c35abfb
Add release notes for "Debugger prints source position information" 2024-02-08 10:08:48 -08:00
Eelco Dolstra 6563a58294
Merge pull request #9964 from fricklerhandwerk/merge-format-sections
move JSON section into Formats and Protocols
2024-02-08 16:53:59 +01:00
Théophane Hufschmitt a8050d9b83
Merge pull request #9928 from 9999years/error-messages-in-nix-repl
Improve error printing in `nix repl`
2024-02-08 16:21:13 +01:00
Théophane Hufschmitt 96686a2a29
Merge pull request #9963 from fricklerhandwerk/fold-sidebar
manual: fold sidebar sections
2024-02-08 16:18:27 +01:00
Théophane Hufschmitt acef4f17a2
Merge pull request #9918 from 9999years/debugger-locals-for-let-expressions
Expose locals from `let` expressions to the debugger
2024-02-08 10:17:55 +01:00
Théophane Hufschmitt c4ed92fa6f
Merge pull request #9917 from 9999years/enter-debugger-more-reliably
Enter debugger more reliably in `let` expressions and function calls
2024-02-08 10:09:54 +01:00
Théophane Hufschmitt 0dea16e686
Mention OPTIMIZE=0 more prominently in the hacking guide
This is a game-changer when developing, it shouldn't just be hidden amongst a list of more advanced variables.
2024-02-08 09:50:12 +01:00
Théophane Hufschmitt f388a6148d
Merge pull request #9919 from 9999years/reduce-debugger-clutter
Reduce visual clutter in the debugger
2024-02-08 09:42:38 +01:00
Valentin Gagarin e486b76eef move JSON section into Formats and Protocols 2024-02-08 09:13:58 +01:00
Valentin Gagarin 140de3b278 manual: fold sidebar sections
the table of contents is very long now, and folded sections allow
for a better overview.
2024-02-08 09:00:00 +01:00
Valentin Gagarin 2d74b56aee fix location of _redirects file
the Netlify `_redirects` file must be in the root directory [0] of the
files to serve, and mdBook copies all the files in `src` that aren't
`.md` to the output directory [1].

[0]: https://docs.netlify.com/routing/redirects/
[1]: https://rust-lang.github.io/mdBook/guide/creating.html#source-files
2024-02-06 23:22:34 +01:00
Rebecca Turner 657a607812
Add release note 2024-02-05 13:21:08 -08:00
Rebecca Turner 155bc761f6
Add release note 2024-02-05 13:16:39 -08:00
Rebecca Turner b63a8d7c46
Add release note 2024-02-05 13:15:29 -08:00
Rebecca Turner 601fc7d159
Add release note 2024-02-05 13:13:26 -08:00
Rebecca Turner 24205a8703
Add release note 2024-02-05 13:00:39 -08:00
Valentin Gagarin 8d4890c3f8
catch multiple use of link reference (#9937) 2024-02-04 21:45:10 +00:00
Valentin Gagarin 8b873edcca
fix anchor link; less weird link texts (#9936) 2024-02-04 21:15:20 +00:00
Valentin Gagarin 721fddac2f
use the right heading level (#9935) 2024-02-04 21:03:13 +00:00
Robert Hensing 4072a8fea0
Merge pull request #9867 from hercules-ci/issue-912
#912 allow leading period
2024-01-31 19:10:59 +01:00
Robert Hensing f1b4663805 Disallow store path names that are . or .. (plus opt. -)
As discussed in the maintainer meeting on 2024-01-29.

Mainly this is to avoid a situation where the name is parsed and
treated as a file name, mostly to protect users.
.-* and ..-* are also considered invalid because they might strip
on that separator to remove versions. Doesn't really work, but that's
what we decided, and I won't argue with it, because .-* probably
doesn't seem to have a real world application anyway.
We do still permit a 1-character name that's just "-", which still
poses a similar risk in such a situation. We can't start disallowing
trailing -, because a non-zero number of users will need it and we've
seen how annoying and painful such a change is.

What matters most is preventing a situation where . or .. can be
injected, and to just get this done.
2024-01-31 18:35:19 +01:00
Robert Hensing b13e6a76b4 parseStorePath: Support leading period 2024-01-31 18:35:19 +01:00
Eelco Dolstra 652f334f87 Edit release notes 2024-01-29 17:51:21 +01:00
Eelco Dolstra 3089bce41b release notes: 2.20.0 2024-01-29 17:14:17 +01:00
Eelco Dolstra 0070400809 maintainers/release-notes: Include changelog-d
Otherwise it quietly generates an empty rl-<version>.md
2024-01-29 17:13:48 +01:00
Eelco Dolstra baff34d728 Don't include store docs in every manpage 2024-01-29 16:30:29 +01:00
Valentin Gagarin 44a0d04483
add missing link (#9869) 2024-01-29 05:56:19 +01:00
Robert Hensing 40254092dd
Merge pull request #9770 from hercules-ci/refactor-rename-derivation-isPure
Refactor rename derivation type `isPure`
2024-01-27 11:24:20 +01:00
Robert Hensing 6a99c18c30 doc/glossary: Define impure derivation 2024-01-27 11:00:10 +01:00
Robert Hensing 5b7bfd2d6b
Merge pull request #9754 from 9999years/print-value-when-coercion-fails
Print the value in `error: cannot coerce` messages
2024-01-24 12:48:39 +01:00
tomberek 1c260fa6d1
Merge pull request #9481 from iFreilicht/disallow-nix-search-without-search-terms
nix search: Disallow empty regex
2024-01-23 20:59:52 -05:00
tomberek 775d59f1fa
Merge pull request #8893 from 9999years/fix-8882
Log what `nix flake check` does
2024-01-23 20:38:23 -05:00
Rebecca Turner 83bb494a30
Print the value in error: cannot coerce messages
This extends the `error: cannot coerce a TYPE to a string` message
to print the value that could not be coerced. This helps with debugging
by making it easier to track down where the value is being produced
from, especially in errors with deep or unhelpful stack traces.
2024-01-23 15:15:41 -08:00
Robert Hensing 5f72a97092
Merge pull request #9753 from 9999years/print-value-on-type-error
Print the value in `value is X while a Y is expected` error
2024-01-22 22:18:16 +01:00
John Ericson 50ce3832dc
Merge pull request #9512 from hercules-ci/release-notes-bdwgc-traceable-allocator-patch
prerequisites-source: Add bdwgc-traceable-allocator-patch
2024-01-22 11:58:43 -05:00
Rebecca Turner cb7fbd4d83
Print value on type error
Adds the failing value to `value is <TYPE> while a <TYPE> is expected`
error messages.
2024-01-22 08:56:02 -08:00
Eelco Dolstra 16ccca2e86
Merge pull request #9703 from fricklerhandwerk/upgrade-no-channel
don't show `nix-channel` in upgrade instructions
2024-01-22 14:46:47 +01:00
John Ericson a0b86b3160
Merge pull request #9760 from hercules-ci/doc-glossary-nix-expression
doc/glossary: Nix expression can be language expression
2024-01-22 08:26:01 -05:00
Théophane Hufschmitt c8d33bca8d
Merge pull request #9822 from obsidiansystems/algo-vs-hash-algo
Start standardizing hash algo flags
2024-01-22 11:08:24 +01:00
John Ericson da1aae2d06
Merge pull request #9821 from obsidiansystems/fix-typo
Fix typo in upcomming release notes
2024-01-20 18:03:25 -05:00
John Ericson 202c5e2afc Start standardizing hash algo flags
Do this if we want to do `--hash-algo` everywhere, and not `--algo` for
hash commands.

The new `nix hash convert` is updated. Deprecated new CLI commands are
left as-is (`nix hash path` needs to be redone and is also left as-is).
2024-01-20 17:29:35 -05:00
John Ericson a93b204c27
Merge pull request #9348 from obsidiansystems/json-formats
Document JSON formats
2024-01-20 17:22:39 -05:00
John Ericson 65294fe5fe Fix typo in upcomming release notes
Thanks @cole-h for finding in https://github.com/NixOS/nix/pull/9815#discussion_r1460604130
2024-01-20 17:07:21 -05:00
John Ericson edf3ecc497 Document JSON formats
Good to document these formats separately from commands that happen to
use them.

Eventually I would like this and `builtins.derivation` to refer to a
store section on derivations that is authoritative, but that doesn't yet
exist, and will take some time to make. So I think we're just best off
merging this now as is.

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2024-01-20 17:03:47 -05:00
Rebecca Turner 561a56cd13
Add release notes 2024-01-20 00:04:06 -08:00
John Ericson 356352c370 Add missing --hash-algo flag to nix store add 2024-01-19 23:11:18 -05:00
John Ericson a34ec0bd12 Include store path exact spec in the docs
This is niche, but deserves to be in the manual because it is describing
behavior visible to the outside world, not mere implementation details.
2024-01-18 22:19:14 -05:00
Robert Hensing 4e8483d09d
Merge pull request #9792 from fricklerhandwerk/move-section
move section on make variables
2024-01-19 00:55:33 +01:00
Robert Hensing 14f470ec4e
doc/hacking.md: Hint short option make -e
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2024-01-19 00:32:30 +01:00
Valentin Gagarin 28eb406834 reword section on make variables
- use one line per sentence
- use imperative for instructions
- add link to Make documentation
2024-01-17 04:39:26 +01:00
Valentin Gagarin f134dbdffb move section on make variables
it should be after the general build instructions, as it goes into more detail.
2024-01-17 04:23:16 +01:00
Valentin Gagarin 55da939424 fix typo 2024-01-17 02:57:11 +01:00
Robert Hensing 2a3c5e6b8b
Merge pull request #9480 from NixOS/libfetchers-git-exportIgnore
libfetchers/git: Support export-ignore
2024-01-16 23:03:46 +01:00
Robert Hensing 51f524c629
Merge pull request #9755 from 9999years/printer-followup
Printer followup
2024-01-16 22:35:08 +01:00
Robert Hensing baea5f42c6
doc/glossary: Simplify software package definition
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2024-01-16 14:50:53 +01:00
Robert Hensing 7e5fa5c25c doc/glossary: Define package and package attribute set
A small step towards https://github.com/NixOS/nix/issues/6507

I believe this incomplete definition is one that can be agreed on.
It would be nice to define more, but considering that the issue
also proposes changes to the design, I believe we should hold off
on those.

As for the wording, we're dealing with some very general and vague
terms, that have to be treated with exactly the right amount of
vagueness to be effective.

I start out with a fairly abstract definition of package.
1. to establish a baseline so we know what we're talking about
2. so that we can go in and clarify that we have an extra, Nix-specific
   definition.

"Software" is notoriously ill-defined, so it makes a great qualifier
for package, which we don't really want to pin down either, because
that would just get us lost in discussion.
We can come back to this after we've done 6057 and a few years in a
desert cave.

Then comes the "package attribute set" definition.
I can already hear Valentin say "That's not even Nix's responsibility!"
and on some days I might even agree.
However, in our current reality, we have `nix-env`, `nix-build` and
`nix profile`, which query the `outputName` attribute - among others -
which just don't exist in the derivation.

For those who can't believe what they're reading:

    $ nix-build --expr 'with import ./. {}; bind // {outputName = "lib";}' --no-out-link
    this path will be fetched (1.16 MiB download, 3.72 MiB unpacked):
      /nix/store/rfk6klfx3z972gavxlw6iypnj6j806ma-bind-9.18.21-lib
    copying path '/nix/store/rfk6klfx3z972gavxlw6iypnj6j806ma-bind-9.18.21-lib' from 'https://cache.nixos.org'...
    /nix/store/rfk6klfx3z972gavxlw6iypnj6j806ma-bind-9.18.21-lib

and let me tell you that bind is not a library.

So anyway, that's also proof of why calling this a "derivation attrset" would be wrong, despite the type attribute.
2024-01-13 20:00:06 +01:00
Robert Hensing e838ac98d4 doc/glossary: Nix expression can be language expression 2024-01-13 19:42:05 +01:00
Qyriad cbd5553d57
doc: provide context in glossary definitions (#9378) 2024-01-13 12:20:08 +01:00
Rebecca Turner f73e50144f
Clarify ambiguity in nix-instantiate man page 2024-01-12 13:53:45 -08:00
Rebecca Turner 2d96c7a51f
Remove outdated reference to y in nix-instantiate man page 2024-01-12 11:27:31 -08:00
Rebecca Turner b29be1ff57
Document unit tests in hacking.md 2024-01-12 10:47:49 -08:00
Eelco Dolstra 8c7e2ed77c Update release notes 2024-01-12 16:21:07 +01:00
Robert Hensing 71d08af15b rl-next: Add *general* note about git fetcher reimpl 2024-01-12 15:31:53 +01:00
Rebecca Turner df84dd4d8d
Restore ambiguous value printer for nix-instantiate
The Nix team has requested that this output format remain unchanged.
I've added a warning to the man page explaining that `nix-instantiate
--eval` output will not parse correctly in many situations.
2024-01-11 16:34:36 -08:00
Valentin Gagarin 6a243e5ed2
fix an old lost direct (#9458)
this part must have been moved quite a while ago, but apparently so far
no one noticed
2024-01-08 19:38:36 +01:00
Valentin Gagarin fe751fbde2 don't show channels in upgrade instructions
channels make everything more stateful, and therefore more complicated
and potentially confusing, but aren't needed for this task, so don't encourage their use.
2024-01-07 01:07:11 +01:00
Valentin Gagarin 8e865f3aba
deduplicate installation instructions (#9507)
* deduplicate installation instructions

- reorder sections to present pinned installation more prominently
- remove outdated notes on the macOS installer rework
- update instructions to handle the installer tarball

Co-authored-by: Travis A. Everett <travis.a.everett@gmail.com>
2024-01-06 22:45:25 +01:00
wiki-me a4d33e816e
Improve documentation around upgrading nix (#9679)
* Improve documentation around upgrading nix, add replacing nix channel with new one

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2024-01-06 18:01:10 +00:00
Rebecca Turner d8a2b06e20
Remove clang11Stdenv
Clang 11 doesn't have support for three-way-comparisons (<=>, "spaceship
operator", "consistent comparisons") and is older than `clangStdenv`.

`clangStdenv` is currently 12 on FreeBSD and Android and 16 on other
platforms:

32e718f00c/pkgs/top-level/all-packages.nix (L16629-L16644)

Let's start by removing Clang 11 from our distribution. Next we can
consider upgrading to Clang 17, which fully supports the spaceship
operator:

https://releases.llvm.org/17.0.1/tools/clang/docs/ReleaseNotes.html#what-s-new-in-clang-release
2024-01-04 11:43:56 -08:00
Robert Hensing 83f5622545
Merge pull request #9658 from pennae/env-diet
reduce the size of Env by one pointer
2023-12-31 13:57:16 +01:00
Robert Hensing 3511430902
Merge pull request #9673 from pennae/drv-parse-opts
optimize derivation parsing
2023-12-31 13:49:03 +01:00
pennae 1fe66852ff reduce the size of Env by one pointer
since `up` and `values` are both pointer-aligned the type field will
also be pointer-aligned, wasting 48 bits of space on most machines. we
can get away with removing the type field altogether by encoding some
information into the `with` expr that created the env to begin with,
reducing the GC load for the absolutely massive amount of single-entry
envs we create for lambdas. this reduces memory usage of system eval by
quite a bit (reducing heap size of our system eval from 8.4GB to 8.23GB)
and gives similar savings in eval time.

running `nix eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system'`

before:

  Time (mean ± σ):      5.576 s ±  0.003 s    [User: 5.197 s, System: 0.378 s]
  Range (min … max):    5.572 s …  5.581 s    10 runs

after:

  Time (mean ± σ):      5.408 s ±  0.002 s    [User: 5.019 s, System: 0.388 s]
  Range (min … max):    5.405 s …  5.411 s    10 runs
2023-12-30 18:55:13 +01:00
pennae 79d3d412ca optimize derivation string parsing
a bunch of derivation strings contain no escape sequences. we can
optimize for this fact by first scanning for the end of a derivation
string and simply returning the contents unmodified if no escape
sequences were found. to make this even more efficient we can also use
BackedStringViews to avoid copies, avoiding heap allocations for
transient data.

before:

Benchmark 1: nix eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system'
  Time (mean ± σ):      6.952 s ±  0.015 s    [User: 5.294 s, System: 1.452 s]
  Range (min … max):    6.926 s …  6.974 s    10 runs

after:

Benchmark 1: nix eval --raw --impure --expr 'with import <nixpkgs/nixos> {}; system'
  Time (mean ± σ):      6.907 s ±  0.012 s    [User: 5.272 s, System: 1.429 s]
  Range (min … max):    6.893 s …  6.926 s    10 runs
2023-12-30 18:44:10 +01:00
Rebecca Turner 7434caca05
Fix segfault on infinite recursion in some cases
This fixes a segfault on infinite function call recursion (rather than
infinite thunk recursion) by tracking the function call depth in
`EvalState`.

Additionally, to avoid printing extremely long stack traces, stack
frames are now deduplicated, with a `(19997 duplicate traces omitted)`
message. This should only really be triggered in infinite recursion
scenarios.

Before:

    $ nix-instantiate --eval --expr '(x: x x) (x: x x)'
    Segmentation fault: 11

After:

    $ nix-instantiate --eval --expr '(x: x x) (x: x x)'
    error: stack overflow

           at «string»:1:14:
                1| (x: x x) (x: x x)
                 |              ^

    $ nix-instantiate --eval --expr '(x: x x) (x: x x)' --show-trace
    error:
           … from call site
             at «string»:1:1:
                1| (x: x x) (x: x x)
                 | ^

           … while calling anonymous lambda
             at «string»:1:2:
                1| (x: x x) (x: x x)
                 |  ^

           … from call site
             at «string»:1:5:
                1| (x: x x) (x: x x)
                 |     ^

           … while calling anonymous lambda
             at «string»:1:11:
                1| (x: x x) (x: x x)
                 |           ^

           … from call site
             at «string»:1:14:
                1| (x: x x) (x: x x)
                 |              ^

           (19997 duplicate traces omitted)

           error: stack overflow
           at «string»:1:14:
                1| (x: x x) (x: x x)
                 |              ^
2023-12-29 22:16:44 -08:00
Brian Le e2399fc949 Change "dervation" typos to "derivation" 2023-12-26 17:12:28 -05:00
Shea Levy c3942ef85f
Build IFD in the build store when using eval-store.
Previously, IFDs would be built within the eval store, even though one
is typically using `--eval-store` precisely to *avoid* local builds.

Because the resulting Nix expression must be copied back to the eval
store in order to be imported, this requires the eval store to trust
the build store's signatures.
2023-12-23 21:33:56 -05:00
Felix Uhl 397cf4e285 nix search: Disallow empty regex
Fixes #4739
Fixes #3553 in spirit IMO
2023-12-21 22:13:43 +01:00
Eelco Dolstra 942d635102 Fix release notes 2023-12-21 16:38:25 +01:00
Eelco Dolstra 9d9d9ff0de Merge remote-tracking branch 'origin/master' into profile-names-instead-of-index 2023-12-21 16:21:26 +01:00
Rebecca Turner 6f4930382b
Document more Makefile variables 2023-12-18 13:34:08 -08:00
John Ericson 7feabf7d44 Split --disable-tests, fix cross builds
It might seem obnoxious to have yet more configure flags, but I found
controlling both the unit and functional tests with one flag was quite
confusing because they are so different:

- unit tests depending on building, functional tests don't (e.g. when
  we test already-built Nix)

- unit tests can be installed, functional tests cannot

- unit tests neeed extra libraries (GTest, RapidCheck), functional
  tests need extra executables (jq).

- unit tests are run by `make check`, functional tests are run by `make
  installcheck`

Really on a technical level, they seem wholly independent. Only on a
human level ("they are both are tests") do they have anything in common.

I had messed up the logic in cross builds because of this. Now I
split the flag in two (and cleaned up a few other inconsistencies), and
the logic fixed itself.

Co-Authored-By: Robert Hensing <roberth@users.noreply.github.com>
2023-12-18 10:47:50 -05:00
Rebecca Turner 7f5ed330e4
Document Makefile variables in hacking.md (#9620) 2023-12-16 12:05:31 +00:00
John Ericson 228e995cde Add release not for eval-system 2023-12-14 19:55:50 -05:00
Ramses 1e3d811840
worker protocol: serialise cgroup stats in BuildResult (#9598)
By doing so, they get reported when building through the daemon via either `unix://` or `ssh-ng://`.
2023-12-13 16:37:17 -05:00
Eelco Dolstra 1b7968ed86
Merge pull request #9547 from hercules-ci/allowed-scheme-without-slash
`allowed-uris`: match whole schemes without slashes
2023-12-13 20:23:33 +01:00
tomberek 7026abfdde
Merge pull request #9523 from fricklerhandwerk/conf-reword-always-allow-substitutes
reword documentation on settings and attributes related to substitution
2023-12-12 20:09:48 -05:00
Robert Hensing 89cf53648c
Contributing branches and reverting (#9577)
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-12-11 12:26:31 +01:00
Robert Hensing a05bc9eb92 allowed-uris: Match whole schemes also when scheme is not followed by slashes 2023-12-11 12:18:04 +01:00
Valentin Gagarin 3c200da242
document fetchTree (#9258)
* document `fetchTree`

* display experimental feature note at the top

we have to enable the new `fetchTree` experimental feature to render it
at all. this was a bug introduced when adding that new feature flag.

Co-authored-by: tomberek <tomberek@users.noreply.github.com>
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
Co-authored-by: Silvan Mosberger <github@infinisil.com>
2023-12-10 05:16:32 +00:00
Robert Hensing 3811b334c6 rl-next: Use markdown frontmatter syntax
The old syntax is still supported, as long as you don't use a {
in the description - the reason to migrate.
2023-12-09 19:57:55 +01:00
Robert Hensing c8458bd731
Merge pull request #9555 from 9999years/positions-in-errors
Pass positions when evaluating
2023-12-09 03:55:58 +01:00
Robert Hensing b9980b377e
Update rl-next/source-positions-in-errors for Nix 2.19+ 2023-12-09 02:36:33 +01:00
Robert Hensing 9b7b7a7561 Revert "Print the value in error: cannot coerce messages (#9553)"
This reverts commit f0ac2a35d5.

The request from the sibling PR, which also applies here, was not addressed.
https://github.com/NixOS/nix/pull/9554#issuecomment-1845095735
2023-12-09 02:13:32 +01:00
Robert Hensing 005eaa1bd6 doc/prerequisites-source: Add bdwgc-traceable-allocator patch 2023-12-08 21:17:41 +01:00
Rebecca Turner f0ac2a35d5
Print the value in error: cannot coerce messages (#9553)
* Print the value in `error: cannot coerce` messages

This extends the `error: cannot coerce a TYPE to a string` message
to print the value that could not be coerced. This helps with debugging
by making it easier to track down where the value is being produced
from, especially in errors with deep or unhelpful stack traces.

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-12-08 16:36:57 +00:00