Commit graph

13126 commits

Author SHA1 Message Date
John Ericson
e64633f98f Flesh out TOC 2022-08-04 12:37:46 +02:00
John Ericson
a2b3160f28 Briefly describe the digest of a store path 2022-08-04 12:37:46 +02:00
John Ericson
523359d133 WIP: Document the design of Nix
The current docs are all "how to do things" and no "what is Nix" or "why
are things the way they are".

I see lots of misconception on the wider internet, and I also think we
would benefit from a "living document" to answer some questions people
currently turn to the thesis for.

I think a new section of the manual can address all these issues.
2022-08-04 12:37:46 +02:00
Valentin Gagarin
499ed26508 manual: remove "Writing Nix Expressions" chapter
it is out of date, all over the place in level of detail, is really
about `nixpkgs`, and in general instructions should not be part of
a reference manual.

also:
- update redirects and internal links
- use "Nix language" consistently
2022-08-04 11:59:25 +02:00
Erik Arvstedt
4c8441be0a docs/flake-update: fix example 2022-08-04 09:45:30 +02:00
Erik Arvstedt
53833dfb40 libexpr/flake: remove FIXME
Line 593 checks that all overrides (i.e. all elements of
`lockFlags.inputOverrides`) are members of `overridesUsed`.
2022-08-04 09:45:29 +02:00
Erik Arvstedt
c9f446ede1 flakeref: fix comment 2022-08-04 09:45:28 +02:00
Max
628ecf950a Merge remote-tracking branch 'nixos/master' 2022-08-03 20:18:29 +02:00
Max
b4c2191838 New nix profile list UI
Also includes a compatibility hack for Home Manager
2022-08-03 20:17:37 +02:00
Eelco Dolstra
075bf6e556
Merge pull request #6861 from edolstra/fix-count-calls
Fix NIX_COUNT_CALLS=1
2022-08-03 18:26:01 +02:00
Eelco Dolstra
ccbd906c86 Fix NIX_COUNT_CALLS=1
Also, make the JSON writer support std::string_view.

Fixes #6857.
2022-08-03 17:46:51 +02:00
Eelco Dolstra
55a10576c1 nix repl: Print accessors in paths 2022-08-03 16:36:20 +02:00
Théophane Hufschmitt
7d1ccd9105
Merge pull request #6846 from fricklerhandwerk/values
manual: use subheadings for primitive types
2022-08-03 14:50:41 +02:00
Théophane Hufschmitt
c55bea4204 Fix the html id of the list headers 2022-08-03 14:16:00 +02:00
Félix Baylac-Jacqué
b47b6a418d
tests/check.sh: add nix3-build check test 2022-08-03 12:17:13 +02:00
Valentin Gagarin
ceed4d4142 encode primitive as list with anchors
to make it consistent with builtins and configuration options
2022-08-03 11:25:41 +02:00
Théophane Hufschmitt
d1cda07ce4 Don't use -load_all on darwin
That flag breaks `-lc++fs` (introducing a duplicate symbol for some
reason). Besides, it was apparently needed for bzip2, but we're not using bzip2
anymore.
2022-08-03 10:27:25 +02:00
Théophane Hufschmitt
1ba5b3e001 Make moveFile more atomic
Rather than directly copying the source to its dest, copy it first to a
temporary location, and eventually move that temporary.
That way, the move is at least atomic from the point-of-view of the destination
2022-08-03 10:27:25 +02:00
Théophane Hufschmitt
90f9680733 Only use renameFile where needed
In most places the fallback to copying isn’t needed and can actually be
bad, so we’d rather not transparently fallback
2022-08-03 10:27:25 +02:00
Théophane Hufschmitt
d71d9e9fbf moveFile -> renameFile
`move` tends to have this `mv` connotation of “I will copy it for you if
needs be”
2022-08-03 10:27:25 +02:00
Théophane Hufschmitt
a4f0fd633c Link against c++fs on darwin
Required by the old clang version
2022-08-03 10:27:25 +02:00
Théophane Hufschmitt
c5db1821a9 Re-implement the recursive directory copy
The recursive copy from the stl doesn’t exactly do what we need because
1. It doesn’t delete things as we go
2. It doesn’t keep the mtime, which change the nars

So re-implement it ourselves. A bit dull, but that way we have what we want
2022-08-03 10:27:25 +02:00
Théophane Hufschmitt
6f89fb6008 rename: Fallback to a copy if the filesystems mismatch
In `nix::rename`, if the call to `rename` fails with `EXDEV` (failure
because the source and the destination are in a different filesystems)
switch to copying and removing the source.

To avoid having to re-implement the copy manually, I switched the
function to use the c++17 `filesystem` library (which has a `copy`
function that should do what we want).

Fix #6262
2022-08-03 10:27:25 +02:00
Théophane Hufschmitt
c2de0a232c Create a wrapper around stdlib’s rename
Directly takes some c++ strings, and gently throws an exception on error
(rather than having to inline this logic everywhere)
2022-08-03 10:27:25 +02:00
Théophane Hufschmitt
8119390abc Move some fs-related functions to their own file
Unclutter `util.cc` a bit
2022-08-03 10:27:25 +02:00
Théophane Hufschmitt
780a479386
Merge pull request #6851 from K900/patch-1
doc/distributed-builds: don't use deprecated alias
2022-08-02 07:17:09 +02:00
Max
16eae95adf Don't warn about saved flake settings 2022-08-01 19:01:52 +02:00
Eelco Dolstra
71b155b9e6 Move download stuff into tarball.hh 2022-08-01 16:05:58 +02:00
Eelco Dolstra
48012603b3 Move FSInputAccessor into a separate file 2022-08-01 16:00:12 +02:00
Eelco Dolstra
55c63c9b89 Remove InputScheme::fetchToStore()
InputSchemes now only have a getAccessor(). They could be implemented
internally by fetching the input to the store, but in that case they
will just return a FSInputAccessor.
2022-08-01 15:44:40 +02:00
K900
f675ba5331
doc/distributed-builds: don't use deprecated alias
`nix ping-store` -> `nix store ping`.
2022-08-01 13:50:35 +03:00
Félix Baylac-Jacqué
1467a98d4c
derivation-goal.cc: remove bmCheck custom return branch on buildDone
Once a derivation goal has been completed, we check whether or not
this goal was meant to be repeated to check its output.

An early return branch was preventing the worker to reach that repeat
code branch, hence breaking the --check command (#2619).

It seems like this early return branch is an artifact of a passed
refactoring. As far as I can tell, buildDone's main branch also
cleanup the tmp directory before returning.
2022-08-01 11:39:19 +02:00
Max
9baab7cd1c Merge remote-tracking branch 'nixos/master' 2022-07-31 21:49:19 +02:00
Jeremy Fleischman
297f6b5d56
Fix link to hacking doc
Right now,
https://hydra.nixos.org/job/nix/master/build.x86_64-linux/latest/download-by-type/doc/manual/contributing/hacking.html
redirects to
https://hydra.nixos.org/build/183877779/download/1/manual/contributing/hacking.html,
which gives me a "500 Internal Server Error". Not super useful =(

Feel free to ignore if someone's working to fix the 500 I was running
into.
2022-07-30 09:12:50 -07:00
Rok Garbas
e9178d7d4a
Merge pull request #6844 from centromere/custom-nix-conf
docker.nix: Allow Nix configuration to be customized
2022-07-29 13:47:24 +02:00
Valentin Gagarin
27138f1ec6
manual: use singular in body, too
Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
2022-07-28 23:30:07 +02:00
Valentin Gagarin
41a3b315fd manual: values -> data types 2022-07-28 17:25:25 +02:00
Valentin Gagarin
8f4fab8fab manual: use singular for headings 2022-07-28 17:25:18 +02:00
Valentin Gagarin
4ff48854b8 manual: simple values -> primitives
"simple" is a loaded term
2022-07-28 17:23:57 +02:00
Valentin Gagarin
3063e5b94c manual: use subheadings for primitive types
this gives us HTML anchors for each of them
2022-07-28 17:23:57 +02:00
Eelco Dolstra
86fcd4f692
Merge pull request #6845 from fricklerhandwerk/attrset
manual: set -> attribute set
2022-07-28 16:55:03 +02:00
Valentin Gagarin
85cdaebcd6 manual: set -> attribute set
reword description to have shorter sentences.
2022-07-28 16:10:24 +02:00
Valentin Gagarin
be4654c344 manual: fix section title in table of contents 2022-07-28 15:55:41 +02:00
Alex Wied
228028fc1a docker.nix: Allow Nix configuration to be customized 2022-07-28 03:36:39 -04:00
Eelco Dolstra
360a1284db Fix onError 2022-07-27 16:41:26 +02:00
Eelco Dolstra
59a8e05754 Fix test 2022-07-27 14:41:32 +02:00
Eelco Dolstra
f780539406 Add abstract interface for writing files to an Input 2022-07-27 14:26:15 +02:00
Eelco Dolstra
bb4d35dcca Make 'nix edit' etc. work again 2022-07-26 17:06:45 +02:00
Eelco Dolstra
1790698a74 Rename fetch() -> fetchToStore(), lazyFetch() -> getAccessor() 2022-07-25 16:30:50 +02:00
Eelco Dolstra
7a64bb7f1c Rename Input::fetch() to fetchToStore() 2022-07-25 15:48:31 +02:00