Commit graph

1284 commits

Author SHA1 Message Date
Eelco Dolstra de13b44573
Branch 2.9 release notes 2022-05-30 20:42:55 +02:00
Eelco Dolstra 8e8e9d8705
Respect the outputSpecified attribute
E.g. 'nix build nixpkgs#libxml2.dev' will build the 'dev' output.
2022-05-30 11:34:47 +02:00
Eelco Dolstra d67a2ae52d
Merge branch 'doc-redirects' of https://github.com/jtojnar/nix 2022-05-27 11:12:41 +02:00
Jan Tojnar 26d1877d6e doc: Add redirects for the DocBook manual
There are still many links to the old manual on the web and
having them end up on the Introduction page is a bad user experience.
2022-05-26 18:17:21 +02:00
Jan Tojnar a793863b97 doc: Manually insert some anchors 2022-05-26 18:17:21 +02:00
Jan Tojnar 7708a34a51 doc: Add anchors to long lists
Added using the following sed scripts:

- For command-ref/opt-common.md:

    s~- `(--?)([^`]+)`~- [`\1\2`]{#opt-\2}~g

- For expressions/builtin-constants.md:

    s~- `(builtins\.?)([^`]+)`~- [`\1\2`]{#builtins-\2}~g

- For expressions/advanced-attributes.md

    s~^  - `([^`]+)`~  - [`\1`]{#adv-attr-\1}~g

  and manually adjusted outputHashAlgo & outputHashMode.

- For glossary.md

    s~^  - (`([^`]+)`|(.+)) ?\\~  - [\1]{#gloss-\2\3}\\~g;
    s~(gloss-\w+) ~\1-~g

  and manually adjusted anchors for Nix expression, user environment, NAR, ∅ and ε.

- For command-ref/env-common.md

    s~^  - `([^`]+)`~  - [`\1`]{#env-\1}~g'
2022-05-26 18:17:21 +02:00
Jan Tojnar 3272afa17b doc: Port anchors preprocessor to jq script
Python is only pulled into the build closure by Mercurial, which might end up being removed.
Let’s port the script to jq, which is more likely to stay.
2022-05-26 18:17:21 +02:00
Jan Tojnar 4de84e095d doc: Introduce pre-processor for adding anchors to text
It is now possible to use the following syntax to insert anchors into the text:

    []{#anchor-name}

The anchor will allow linking to the location it is placed by appending #anchor-name to the URL.

Additionally, it is possible to create a link pointing to its own location by adding text between the square brackets:

    [`--add-root`]{#opt-add-root}
2022-05-26 17:54:15 +02:00
Eelco Dolstra 8f4548d401
Tweak IN_NIX_SHELL description 2022-05-26 12:40:01 +02:00
Ben Burdette 9a5ea6c359
Merge branch 'master' into debug-exploratory-PR 2022-05-25 10:41:10 -06:00
Ben Burdette 6031a36208 add --debugger to rl-next list 2022-05-25 10:38:13 -06:00
Tony Olagbaiye 5b8c1deb18 fetchTree: Allow fetching plain files
Add a new `file` fetcher type, which will fetch a plain file over
http(s), or from the local file.

Because plain `http(s)://` or `file://` urls can already correspond to
`tarball` inputs (if the path ends-up with a know archive extension),
the URL parsing logic is a bit convuluted in that:

- {http,https,file}:// urls will be interpreted as either a tarball or a
  file input, depending on the extensions of the path part (so
  `https://foo.com/bar` will be a `file` input and
  `https://foo.com/bar.tar.gz` as a `tarball` input)
- `file+{something}://` urls will be interpreted as `file` urls (with
  the `file+` part removed)
- `tarball+{something}://` urls will be interpreted as `tarball` urls (with
  the `tarball+` part removed)

Fix #3785

Co-Authored-By: Tony Olagbaiye <me@fron.io>
2022-05-19 18:24:49 +02:00
Théophane Hufschmitt 65a913d29b Don’t recommend writing unit tests
As asked in <https://github.com/NixOS/nix/pull/6517#discussion_r869416905>
2022-05-12 12:02:31 +02:00
Théophane Hufschmitt 7c75f1d52b Expand the testing section of the hacking docs
- Make it clear what the different kind of tests are, where they live
  and how they can be ran
- Ask people to primarily write unit tests
2022-05-10 13:35:23 +02:00
Eelco Dolstra 4a79cba511 Allow selecting derivation outputs using 'installable!outputs'
E.g. 'nixpkgs#glibc^dev,static' or 'nixpkgs#glibc^*'.
2022-05-03 13:43:52 +02:00
midchildan c67d8876c3
feat: add integration with zsh's run-help 2022-04-25 02:21:41 +09:00
Théophane Hufschmitt be28603dca Merge remote-tracking branch 'origin/master' into nixbuildaddprintstorepaths 2022-04-22 11:11:01 +02:00
Tom Bereknyei f25112d383 fix: builtins.toFile adds path to allowedPaths
The produced path is then allowed be imported or utilized elsewhere:
```
assert (43 == import (builtins.toFile "source" "43")); "good"
```

This will still fail on write-only stores.
2022-04-21 16:41:37 -04:00
Artturin 51cfea8bb0 nix build: add --print-out-paths flag
has the same functionality as default nix-build

$ nix-build . -A "bash" -A "bash.dev" -A "tinycc"
/nix/store/4nmqxajzaf60yjribkgvj5j54x9yvr1r-bash-5.1-p12
/nix/store/c49i1ggnr5cc8gxmk9xm0cn961z104dn-bash-5.1-p12-dev
/nix/store/dbapb08862ajgaax3621fz8hly9fdah3-tcc-0.9.27+date=2022-01-11

$ nix-build . -A "bash"
/nix/store/4nmqxajzaf60yjribkgvj5j54x9yvr1r-bash-5.1-p12

$ $HOME/nixgits/nix/result/bin/nix build "nixpkgs#bash" "nixpkgs#bash.dev" "nixpkgs#tinycc" --print-out-paths
/nix/store/4nmqxajzaf60yjribkgvj5j54x9yvr1r-bash-5.1-p12
/nix/store/c49i1ggnr5cc8gxmk9xm0cn961z104dn-bash-5.1-p12-dev
/nix/store/dbapb08862ajgaax3621fz8hly9fdah3-tcc-0.9.27+date=2022-01-11

$ $HOME/nixgits/nix/result/bin/nix build "nixpkgs#bash" --print-out-paths
/nix/store/4nmqxajzaf60yjribkgvj5j54x9yvr1r-bash-5.1-p12
2022-04-20 19:35:46 +03:00
mei (ckie) 0e2b01b14e
nix repl: make symlinks with the :bl command
Requested by ppepino on the Matrix:
https://matrix.to/#/!KqkRjyTEzAGRiZFBYT:nixos.org/$Tb32BS3rVE2BSULAX4sPm0h6CDewX2hClOTGzTC7gwM?via=nixos.org&via=matrix.org&via=nixos.dev

This adds a new command, :bl, which works like :b but also creates
a GC root symlink to the various derivation outputs.

ckie@cookiemonster ~/git/nix -> ./outputs/out/bin/nix repl
Welcome to Nix 2.6.0. Type :? for help.

nix-repl> :l <nixpkgs>
Added 16118 variables.

nix-repl> :b runCommand "hello" {} "echo hi > $out"

This derivation produced the following outputs:
  ./repl-result-out -> /nix/store/kidqq2acdpi05c4a9mlbg2baikmzik44-hello
[1 built, 0.0 MiB DL]
ckie@cookiemonster ~/git/nix -> cat ./repl-result-out
hi
2022-04-20 00:20:29 +03:00
Eelco Dolstra 1cdad1074c Move rl-next.md to rl-2.8.md 2022-04-19 21:12:33 +02:00
Tom Bereknyei 9b41239d8f fix: ensure apps are apps and packages are packages 2022-04-14 23:57:52 -04:00
Rehno Lindeque 5ff4c42608 Update release notes 2022-04-06 12:24:35 -04:00
Eelco Dolstra 71c07ac0e7
Merge pull request #6363 from thufschmitt/definition-list-in-nix.conf-manual
Add anchors to the nix.conf options in the manual
2022-04-05 17:32:48 +02:00
Eelco Dolstra f98d76ff1a rl-2.7.md: Fix title 2022-04-05 14:13:26 +02:00
Théophane Hufschmitt 660c19eb49 manual: Add some anchor targets for the nix.conf options
For each `nix.conf` option, add an empty html node with a unique `id`
that can be used as an anchor target. Also make the name of the option
be a link to that target so that it’s easily discoverable.

We can’t rewrite the whole list as an html definition list like it’s
done for the builtins because these options also appear in a man page,
and the manpage renderer (lowdown) can’t render arbitrary html. But the
hack here allows to keep the manpage and have the links in the html
version.

Fix https://github.com/NixOS/nix/issues/5745
2022-04-05 13:50:42 +02:00
Eelco Dolstra d63a5f5dd3 Update release notes 2022-03-31 17:33:06 +02:00
Eelco Dolstra 86b05ccd54 Only provide builtin.{getFlake,fetchClosure} is the corresponding experimental feature is enabled
This allows writing fallback code like

  if builtins ? fetchClosure then
    builtins.fetchClose { ... }
  else
    builtins.storePath ...
2022-03-25 14:04:18 +01:00
Eelco Dolstra 98658ae9d2 Document fetchClosure 2022-03-24 21:33:33 +01:00
Eelco Dolstra 5acaf13d35 Rename 'nix store make-content-addressable' to 'nix store make-content-addressed' 2022-03-24 21:33:33 +01:00
Domen Kožar 98ce1a21b7
Merge pull request #6144 from toonn/doc-macos-uninstall
doc: Add detailed uninstall section for macOS
2022-03-23 08:53:48 +01:00
Théophane Hufschmitt 7117053457
Merge pull request #6270 from Artturin/stdineval
nix: allow using --file - to read from stdin
2022-03-17 14:35:01 +01:00
Artturin a5c969db49 nix: allow using --file - to read from stdin 2022-03-16 21:01:51 +02:00
Joachim Breitner af013281c9
distributed-builds.md: fixing typo of the most minor sort 2022-03-16 12:53:38 +01:00
Eelco Dolstra ad7c99ef20 Move rl-next.md to rl-2.7.md 2022-03-07 20:10:18 +01:00
Eelco Dolstra 0123b9aec8 Tweak release notes 2022-03-07 19:56:10 +01:00
Eelco Dolstra 30ddd37873 Merge branch 'cli-suggestions' of https://github.com/thufschmitt/nix 2022-03-07 19:47:45 +01:00
Eelco Dolstra c28e2b1b29 Tweak release notes 2022-03-07 11:30:40 +01:00
regnat b44cebd1fd Add a release-notes entry for the cli suggestions 2022-03-07 10:09:10 +01:00
toonn 947d4761b3
doc: Add removal of darwin-store LaunchDaemon
The uninstall instructions used to accidentally remove the nix-darwin
LaunchDaemon, this was dropped. However, the original intent was to
remove the Store volume mounting LaunchDaemon.
2022-02-26 14:16:35 +01:00
toonn 2df23e2b3e
doc: Drop nix-darwin service from macOS uninstall 2022-02-25 10:50:01 +01:00
toonn 064cad7e9f
doc: Add macOS uninstall note about /nix
Clarify that `/nix` being present after the uninstall is normal and it
will only disappear after a reboot.

Co-authored-by: Travis A. Everett <travis.a.everett@gmail.com>
2022-02-25 10:32:45 +01:00
Eelco Dolstra 59683733f5
Merge pull request #6089 from edolstra/dot-default
Replace defaultBla.$system with bla.$system.default
2022-02-24 21:16:58 +01:00
Guillaume Desforges cfbf9ee2ce Anchor with prefix 2022-02-24 13:50:50 +01:00
Guillaume Desforges 6462ee61c7 Anchor link for builtin functions in HTML doc 2022-02-23 15:07:01 +01:00
Guillaume Desforges 2cc645a91a Add html make target 2022-02-23 15:06:13 +01:00
Théophane Hufschmitt 54f07b66c8
Precise the doc for --include-outputs
Make it explicit that it only includes the existing outputs and not the ones that haven’t been realised
2022-02-23 09:17:08 +01:00
toonn 400d70a3a9
doc: Add detailed uninstall section for macOS
The multi-user installation on macOS, which is now the only option, has
gotten complicated enough that it discourages some users from checking
Nix out for fear of being left with a "dirty" system. Detailed
uninstallation instructions should make this less of an issue.
2022-02-22 16:28:24 +01:00
Eelco Dolstra 38eea2c503 Update release notes 2022-02-22 14:23:39 +01:00
Eelco Dolstra 26e99c817c
Merge pull request #6114 from Radvendii/welcomeText
add release notes for welcomeText
2022-02-18 10:52:03 +01:00