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

2435 commits

Author SHA1 Message Date
Robert Hensing 7275d68d3b rl-next: Add top 10 by +1 reactions on PRs
We should use a metric that weighs the related issues.
Counterbalancing time doesn't make much sense to me.
If it's around for longer, the fix will be relevant to more people.
2024-07-25 05:57:53 +02:00
Robert Hensing 8a7e31362a rl-next: Add credit 2024-07-25 05:57:06 +02:00
Valentin Gagarin a2fed6db9e
manual: Contributing -> Development, Hacking -> Building (#9014)
* manual: Contributing -> Development, Hacking -> Building

what's currently called "hacking" are really instructions for setting up
a development environment and compiling from source. we have
a contribution guide in the repo (which rightly focuses on GitHub
workflows), and the material in the manual is more about working
on the code itself.

since we'd otherwise have three headings that amount to "Building Nix",
this change also moves the "classic Nix" instructions to the top.

we may want to reorganise this in the future, and bring
contributor-oriented information closer to the code, but for now let's
stick to more accurate names to ease navigation.
2024-07-25 02:53:06 +00:00
Valentin Gagarin dba1142c01
docs: add identifiers (#11174)
* docs: add identifiers

* clarify attribute set notation and add examples

* add definition of names

Co-authored-by: Ryan Hendrickson <ryan.hendrickson@alum.mit.edu>
2024-07-25 03:45:34 +02:00
Robert Hensing 4bfc96f376 Fix and update release notes 2024-07-24 19:36:49 +02:00
Ryan Hendrickson e086d5d899 libexpr: experimental pipe operators 2024-07-24 13:17:28 -04:00
Eelco Dolstra ca0f7db843 Remove hacks to support evaluation from coroutines
Since we're not doing this anymore.
2024-07-24 16:43:25 +02:00
Eelco Dolstra 17051ca80a
Merge pull request #11061 from rhendric/rhendric/reference-manual
docs: fill out language/types.md#type-path
2024-07-17 21:59:05 +02:00
Eelco Dolstra 1e1a8e8ad1
Merge pull request #11058 from hercules-ci/more-nix-shell
Make `#!nix-shell` arguments and options relative to script
2024-07-17 21:52:34 +02:00
RTUnreal f0a1c130a1
doc: add example usage for Gitea in tarball fetcher (#11116)
Co-authored-by: Valentin Gagarin <valentin@gagarin.work>
2024-07-17 19:08:33 +00:00
Robert Hensing d4f576b0b2 nix repl: Render docs for attributes 2024-07-15 19:56:40 +02:00
Robert Hensing 7fae378835 Track doc comments and render them in :doc 2024-07-15 19:56:40 +02:00
Robert Hensing 63f520fd00 doc/testing: Typo 2024-07-15 18:41:11 +02:00
Andrew Marshall 51a12b38bd Fix stackoverflow during doc generation
On some systems, previous usage of `match` may cause a stackoverflow
(presumably due to the large size of the match result). Avoid this by
(ab)using `replaceStrings` to test for containment without using
regexes, thereby avoiding the issue. The causal configuration seems to
be the stack size hard limit, which e.g. Amazon Linux sets, whereas most
Linux distros leave unlimited.

Match the fn name to similar fn in nixpkgs.lib, but different
implementation that does not use `match`. This impl gives perhaps
unexpected results when the needle is `""`, but the scope of this is
narrow and that case is a bit odd anyway.

This makes for some duplication-of-work as we do a different
`replaceStrings` if this one is true, but this only runs during doc
generation at build time so has no runtime impact.

See https://github.com/NixOS/nix/issues/11085 for details.
2024-07-12 10:59:40 -04:00
Robert Hensing 6f5f741157 doc/rl-next/shebang-relative: Update with example 2024-07-11 13:52:03 +02:00
Robert Hensing d942d505ca Merge remote-tracking branch 'upstream/master' into more-nix-shell 2024-07-10 16:19:18 +02:00
Robert Hensing cfe3ee3de8
nix-shell: look up shell.nix when argument is a directory (#11057)
* Refactor: rename runEnv -> isNixShell

* Refactor: rename left -> remainingArgs

* nix-build.cc: Refactor: extract baseDir variable

* nix-build.cc: Refactor: extract sourcePath, resolvedPath variables

* nix-shell: Look for shell.nix when directory is specified

* Add legacy setting: nix-shell-always-looks-for-shell-nix

* rl-next: Add note about shell.nix lookups

* tests/functional/shell.nix: Implement runHook for dummy stdenv
2024-07-08 14:36:36 +02:00
Ryan Hendrickson 48804cffbf docs: fill out language/types.md#type-path 2024-07-08 00:41:19 -04:00
Ryan Hendrickson 95890b3e1d docs: merge builtin-constants into builtins 2024-07-07 15:57:23 -04:00
Robert Hensing 63262e78c7 Add opt-out: nix-shell-shebang-arguments-relative-to-script 2024-07-07 00:55:33 +02:00
Robert Hensing d5854f33e2 rl-next: Typo 2024-07-07 00:18:26 +02:00
Robert Hensing 8838f5c746 Merge remote-tracking branch 'matthewbauer/nix-shell-relative-shebang' into more-nix-shell 2024-07-07 00:18:03 +02:00
Robert Hensing afbe7c3d08 rl-next: Enter PR 2024-07-06 23:15:01 +02:00
Robert Hensing a22f8b5276 rl-next: Add note about shell.nix lookups 2024-07-06 23:05:34 +02:00
Robert Hensing ddff76f667
Merge pull request #10973 from NixOS/meson-libexpr
Meson build for libexpr libflake, external C API, unit tests
2024-07-05 20:27:12 +02:00
Valentin Gagarin a713476790
docs: split types from syntax (#11013)
move together all syntactic and semantic information into one
page, and add a page on data types, which in turn links to the syntax and
semantics.

also split out the note on scoping rules into its own page.

Co-authored-by: Ryan Hendrickson <ryan.hendrickson@alum.mit.edu>
2024-07-03 09:03:41 +02:00
John Ericson 11dab30be9 Update docs on the unit tests 2024-07-02 09:26:22 -04:00
John Ericson 496b4a9cd2 Move around unit test dirs to match new names 2024-07-02 09:26:22 -04:00
John Ericson 17a8c2bfce Unit tests and external libraries 2024-07-02 09:23:24 -04:00
Sergei Trofimovich 5a16bf86c5
doc: fix directory definition in nix-archive.md (#10997)
* doc: fix `directory` definition in nix-archive.md

Before the change the document implied that directory of a single entry
contained entry:

    "type" "directory" "type" directory" "entry" ...

After the change document should expand into:

   "type" "directory" "entry" ...

Co-authored-by: John Ericson <git@JohnEricson.me>
2024-06-30 16:22:04 +00:00
Valentin Gagarin b44909ac22
add many more examples on escaping in strings (#10974) 2024-06-27 10:58:59 +02:00
Harmen 3b388f6629
string interpolation escape example (#10966)
* string interpolation escape example

Make it easier to find the documentation, and the example might be enough for most cases.

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2024-06-27 08:30:21 +00:00
Winter 149d8eb8aa Stop vendoring toml11
We don't apply any patches to it, and vendoring it locks users into
bugs (it hasn't been updated since its introduction in late 2021).

Closes https://git.lix.systems/lix-project/lix/issues/164

Change-Id: Ied071c841fc30b0dfb575151afd1e7f66970fdb9
(cherry picked from commit 80405d06264f0de1c16ee2646388ab501df20628)
2024-06-26 22:27:13 -04:00
John Ericson 32e67eba8b Remove invalid release notes YAML field
There is no PR for this, since it was an embargoed fix before
disclosure.
2024-06-26 19:35:57 -04:00
John Ericson 8a420162ab Merge branch 'master' into fix-sandbox-escape 2024-06-26 18:11:39 -04:00
Robert Hensing 052f1320dd
Merge pull request #10960 from rhendric/rhendric/reference-manual
docs: internal documentation touchup
2024-06-26 01:16:45 +02:00
Ryan Hendrickson fba81cf74b docs: internal documentation touchup
Make two comments more accurate for the next reader.
2024-06-25 18:44:56 -04:00
Robert Hensing 602c444411 Merge remote-tracking branch 'upstream/master' into functional-tests-on-nixos 2024-06-24 18:07:21 +02:00
Robert Hensing 6f64154eea
Merge pull request #10884 from tomberek/tomberek.warn_structuredAttrs_advanced
fix: warn and document when advanced attributes will have no impact d…
2024-06-24 07:56:26 +02:00
Théophane Hufschmitt d99c868b04 Add a release note for the build-dir hardening 2024-06-21 17:06:19 +02:00
Robert Hensing fca160fbcd doc/contributing/testing: Describe functional VM tests and quickBuild 2024-06-20 14:54:11 +02:00
Valentin Gagarin 1c131ec2b7
Port C API docs to Meson (#10936)
* Port C API docs to Meson

* don't cross-compile the docs
2024-06-19 22:43:54 +02:00
John Ericson 0c6029669d
Merge pull request #10935 from fricklerhandwerk/cli-docs-formatting
use separate paragraphs inside list items
2024-06-18 15:24:44 -04:00
Valentin Gagarin b975151c09 dedent lists
this indentation is unnecessary and probably an artefact from the
migration off XML.
2024-06-18 11:26:09 +02:00
Valentin Gagarin 6e34c68327 Convert the internal API doc build to Meson 2024-06-17 15:51:58 -04:00
Valentin Gagarin 4f340213bb use separate paragraphs inside list items 2024-06-17 17:55:29 +02:00
Valentin Gagarin d1dd7abbf0
mention the actual meaning of FODs in the glossary (#10888)
* mention the actual meaning of FODs in the glossary

Co-authored-by: Alex Groleau <source@proof.construction>
Co-authored-by: Daniel Baker <daniel.n.baker@gmail.com>
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2024-06-10 20:50:35 +02:00
Tom Bereknyei 4809e59b7e fix: warn and document when advanced attributes will have no impact due to __structuredAttrs 2024-06-10 09:31:21 -04:00
Eelco Dolstra b36aa04b53
Merge pull request #10836 from edolstra/release-notes
2.23 release notes
2024-06-04 13:00:06 +02:00
Eli Flanagan bf72b78ef2
docs: fix python nix-shell example (#10841)
* docs: fix python nix-shell example

This Python code snippet depended on Python 2 which has been marked as insecure in 24.05.

I modernized the example so new users will not be surprised upon copying and pasting the snippet for exploration.

Co-authored-by: John Ericson <git@JohnEricson.me>
2024-06-03 23:22:50 +02:00
Eelco Dolstra e0885fc216 Fix link 2024-06-03 20:02:03 +02:00
Robert Hensing 9019b7a37a doc/rl-2.23.md: Fix broken link 2024-06-03 18:56:04 +02:00
Eelco Dolstra 879089e80d Edit release notes 2024-06-03 18:13:37 +02:00
Eelco Dolstra 754ea9058d release notes: 2.23.0 2024-06-03 18:06:42 +02:00
Eelco Dolstra da92ad7dd2
Merge pull request #10592 from hercules-ci/builtins-warn
Add `builtins.warn`
2024-06-03 17:16:32 +02:00
Robert Hensing 3a0b0af2ac Fix typo in doc/manual/rl-next/builtins-warn.md
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
2024-06-03 16:24:21 +02:00
Robert Hensing 70b1036224 builtins.warn: Use new EvalBaseError + "evaluation warning" 2024-06-03 16:24:21 +02:00
Eelco Dolstra 54a9fbe5d6 Merge remote-tracking branch 'origin/master' into large-path-warning 2024-06-03 16:17:52 +02:00
Eelco Dolstra ac3e5d22e3
Merge pull request #10028 from DavHau/fetchTree-shallow-default
fetchTree: shallow git fetching by default
2024-06-03 16:02:34 +02:00
Eelco Dolstra d2bfc7e55a Add release note 2024-06-03 15:55:19 +02:00
John Ericson 84c65135a5 ValidPathInfo JSON format should use null not omit field
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2024-06-03 08:21:22 -04:00
John Ericson c50e14276e manual: Extend JSON guidlines with optional field info
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2024-06-03 08:21:18 -04:00
John Ericson 57aa901071 manual: Put the JSON guideline on its own page 2024-06-03 08:11:02 -04:00
Robert Hensing c692f6af13 nix env shell: Move from nix shell, add shorthand alias 2024-05-30 19:41:58 +02:00
Qyriad 18ac6545fc print type and value in "flake attr is not a derivation" errors
This turns errors like:

error: flake output attribute 'hydraJobs' is not a derivation or path

into errors like:

error: expected flake output attribute 'hydraJobs' to be a derivation or
path but found a set: { binaryTarball = «thunk»; build = «thunk»; etc> }

This change affects all InstallableFlake commands.

Source: 20981461d4
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
2024-05-29 20:51:32 +02:00
Jörg Thalheim e2182d07d9 fixup extension of changelog entry 2024-05-29 20:51:32 +02:00
Martin Joerg e7ea5591a2 fix typos 2024-05-27 15:56:52 +02:00
Valentin Gagarin 77cb02b739
reword documentation on nix-copy-closure (#10709)
* reword documentation on `nix-copy-closure`

- one sentence per line
- be more precise with respect to which Nix stores are being accessed
- make a clear distinction between store paths and store objects
- add links to definitions of terms
- clarify which machine is which
- --to and --from don't take arguments

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2024-05-21 18:06:16 +02:00
Valentin Gagarin 117dbc2c46 add examples of comments
make a suggestion for what to do if one wants to write nested comments
2024-05-21 16:49:46 +02:00
Valentin Gagarin 40b7fb4f11
expand example on nix-copy-closure (#10708)
* expand example on nix-copy-closure


Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2024-05-20 20:45:45 +00:00
Valentin Gagarin fc14378ae3
add cross-references for discoverability (#10714) 2024-05-20 20:39:34 +00:00
Robert Hensing 8953bdbf32
Merge pull request #10715 from fricklerhandwerk/remove-copy-closure-guide
redirect "Copying Closures via SSH" guide to `nix-copy-closure`
2024-05-20 18:10:27 +02:00
Robert Hensing 67db9e0c64
Merge pull request #10722 from obsidiansystems/ca-obj-docs
Content addressing store objects
2024-05-20 15:58:29 +02:00
John Ericson 4c91bc543c Remove store object content address reproducibility section 2024-05-20 09:34:38 -04:00
John Ericson 1c75af969a Document store object content addressing & improve JSON format
The JSON format no longer uses the legacy ATerm `r:` prefixing nonsese,
but separate fields.

Progress on #9866

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2024-05-20 09:34:35 -04:00
Robert Hensing e4be8abe42
Merge pull request #10701 from cole-h/nix-command-warn-unknown-settings
Warn on unknown settings when the first positional is an argument
2024-05-20 15:15:13 +02:00
Valentin Gagarin 209d75529c
reword documentation on nix-store --export (#10713)
- add links to definitions of terms
- one sentence per line
- be more specific about which store is used for the import
- clearly distinguish store paths and store objects
- make a recommendation to use `nix-copy-closure` for efficient SSH transfers
2024-05-20 08:28:35 +02:00
tomberek 7cb3c80bb5
Merge pull request #10711 from fricklerhandwerk/nix-store-export-example
make a more relevant example for `nix-store --export`
2024-05-19 13:29:54 -04:00
tomberek 6193737ca1
Merge pull request #10710 from fricklerhandwerk/nix-store-import-example
add example to `nix-store --import`
2024-05-19 13:27:36 -04:00
Maximilian Bosch 19720d733f nix3-build: show all FOD errors with --keep-going
Basically I'd expect the same behavior as with `nix-build`, i.e.
with `--keep-going` the hash-mismatch error of each failing
fixed-output derivation is shown.

The approach is derived from `Store::buildPaths` (`entry-point.cc`):
instead of throwing the first build-result, check if there are any build
errors and if so, display all of them and throw after that.

Unfortunately, the BuildResult struct doesn't have an `ErrorInfo`
(there's a FIXME for that at least), so I have to construct my own here.
This is a rather cheap bugfix and I decided against touching too many
parts of libstore for that (also I don't know if that's in line with the
ongoing refactoring work).

Closes https://git.lix.systems/lix-project/lix/issues/302

Change-Id: I378ab984fa271e6808c6897c45e0f070eb4c6fac
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
2024-05-17 18:48:52 +02:00
fidgetingbits c66796d460
fix typo in testing documentation 2024-05-17 08:38:57 +08:00
Robert Hensing 303268bb71
Merge pull request #10479 from obsidiansystems/ca-fso-docs
Document file system object content addressing
2024-05-15 22:52:53 +02:00
Valentin Gagarin d50ce2df14 make a more relevant example for nix-store --export
given `nix-copy-closure` exists, it doesn't make much sense to do

    nix-store --export $paths | nix-store --import --store ssh://foo@bar

since that dumps everything rather than granularly transferring store
objects as needed.

therefore, pick an example where dumping the entire closure into a file
actually makes a difference, such as when deploying to airgapped systems.
2024-05-15 22:37:14 +02:00
John Ericson 043135a848 Document file system object content addressing
In addition:

- Take the opportunity to add a bunch more missing hyperlinks, too.

- Remove some glossary entries that are now subsumed by dedicated pages.
  We used to not be able to do this without breaking link fragments, but
  now we can, so pick up where we left off.

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2024-05-15 16:28:48 -04:00
Daniel Ramírez 50bbe22a51
reword nix-env documentation (#10718)
* reword `nix-env` documentation

- added links
- added an overview of package sources
- clarified parsing and matching of package names

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2024-05-15 19:42:14 +00:00
Cole Helbling 39a269657e libutil/args: warn on unknown settings after parsing all flags 2024-05-15 12:25:03 -07:00
John Ericson bbe780b137
Merge pull request #10712 from fricklerhandwerk/reword-nix-store-import-docs
reword documentation on `nix-store --import`
2024-05-15 13:17:36 -04:00
Valentin Gagarin 6907eaad4f reword documentation on nix-store --import
- add links to definitions of terms
- one sentence per line
- be more specific about which store is used for the import
- clearly distinguish store paths and store objects
- make a recommendation to use `nix-copy-closure` for efficient SSH transfers
2024-05-15 01:59:07 +02:00
Valentin Gagarin 7c7aa79ebe redirect "Copying Closures via SSH" guide to nix-copy-closure
the individual commands' documentation should provide enough examples to
make sense of the options and judge what to use and when. proper guides,
which would require a more elaborate setup to show off Nix's
capabilities are out of scope for the reference manual.
2024-05-15 01:29:10 +02:00
Valentin Gagarin dcc2a51bac add example to nix-store --import
this also features specifying `--store` to give more pointers for
discoverability
2024-05-15 01:11:14 +02:00
Valentin Gagarin 49bd408c10
remove link to relocated manual page (#10703)
fix old anchor redirects to point to the correct location
2024-05-14 21:18:40 +00:00
Eli Flanagan 05ad4e8806
doc: convention improvements for copying closure (#10702)
* doc: convention improvements for copying closure

   use -P, which only considers executables but not shell builtins

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2024-05-14 20:38:54 +00:00
Valentin Gagarin 2f0031aedc
Revert "manual: fold sidebar sections" (#10698)
The original change arguably reduced ergonomics of navigation, since menu items weren't ctrl+f searchable any more.
2024-05-14 19:23:29 +00:00
Valentin Gagarin 33ca905cdb tests: simplify initialisation and wiring
pararameterisation is not actually needed the way things are currently
set up, and it confused me when trying to understand what the code does.

all but one test sources vars-and-functions.sh, which nominally only
defines variables, but in practice is always coupled with the actual
initialisation. while the cleaner way of making this more legible would
be to source variables and initialisation separately, this would produce
a huge diff.

the change requires a few small fixes to keep the tests working:

- only create test home directory during initialisation

  that vars-and-functions.sh wrote to the file system seems not write

- fix creation of the test directory

  due to statefulness, the test home directory was implicitly creating
  the test root, too. decoupling that made it apparent that this was
  probably not intentional, and certainly confusing.

- only source vars-and-functions.sh if init.sh is not needed

  there is one test case that only needs a helper function but no
  initialisation side effects

- remove some unnecessary cleanups and split parts of re-used test code

  there were confusing bits in how initialisation code was repurposed,
  which break if trying to refactor the outer layers naively...
2024-05-13 15:19:49 +02:00
Eelco Dolstra de8c3c034c
Merge pull request #10668 from edolstra/unit-prefixes
Support unit prefixes in configuration settings
2024-05-09 19:29:36 +02:00
John Ericson b5605217ae
Document string context (#8595)
* Document string context

Now what we have enough primops, we can document how string contexts
work.

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
Co-authored-by: Théophane Hufschmitt <7226587+thufschmitt@users.noreply.github.com>
Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Co-authored-by: Felix Uhl <iFreilicht@users.noreply.github.com>
2024-05-08 23:14:00 +02:00
Eelco Dolstra 79c7d6205c Support unit prefixes in configuration settings
E.g. you can now say `--min-free 1G`.
2024-05-08 21:11:09 +02:00
John Ericson d8d20307a8
Merge pull request #10620 from nh2/patch-2
manual: language: Explain that `with` does not shadow
2024-05-08 11:41:21 -04:00
John Ericson a5252c9979
doc: Reword scoping section
"dynamic scope" is not accurate, so reword. The underlying idea is good however.
2024-05-08 11:18:17 -04:00
Sizhe Zhao f83617f052
fix(doc/manual/src/command-ref/nix-env/install): fix typo 2024-05-08 14:24:23 +08:00