Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into lazy-trees
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Apr 30, 2024
2 parents 1302bfa + 4161f3c commit 9c10fcf
Show file tree
Hide file tree
Showing 36 changed files with 574 additions and 303 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.22.0
2.23.0
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Check out the [security policy](https://github.com/NixOS/nix/security/policy).
1. Search for related issues that cover what you're going to work on.
It could help to mention there that you will work on the issue.

We strongly recommend first-time contributors not to propose new features but rather fix tightly-scoped problems in order to build trust and a working relationship with maintainers.

Issues labeled [good first issue](https://github.com/NixOS/nix/labels/good%20first%20issue) should be relatively easy to fix and are likely to get merged quickly.
Pull requests addressing issues labeled [idea approved](https://github.com/NixOS/nix/labels/idea%20approved) or [RFC](https://github.com/NixOS/nix/labels/RFC) are especially welcomed by maintainers and will receive prioritised review.

Expand Down
11 changes: 11 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,17 @@ case "$host_os" in
[CXXFLAGS="$LIBSECCOMP_CFLAGS $CXXFLAGS"])
have_seccomp=1
AC_DEFINE([HAVE_SECCOMP], [1], [Whether seccomp is available and should be used for sandboxing.])
AC_COMPILE_IFELSE([
AC_LANG_SOURCE([[
#include <seccomp.h>
#ifndef __SNR_fchmodat2
# error "Missing support for fchmodat2"
#endif
]])
], [], [
echo "libseccomp is missing __SNR_fchmodat2. Please provide libseccomp 2.5.5 or later"
exit 1
])
else
have_seccomp=
fi
Expand Down
2 changes: 1 addition & 1 deletion doc/external-api/local.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$(docdir)/external-api/html/index.html $(docdir)/external-api/latex: $(d)/doxygen.cfg
$(docdir)/external-api/html/index.html $(docdir)/external-api/latex: $(d)/doxygen.cfg src/lib*-c/*.h
mkdir -p $(docdir)/external-api
{ cat $< ; echo "OUTPUT_DIRECTORY=$(docdir)/external-api" ; } | doxygen -

Expand Down
2 changes: 1 addition & 1 deletion doc/internal-api/local.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$(docdir)/internal-api/html/index.html $(docdir)/internal-api/latex: $(d)/doxygen.cfg
$(docdir)/internal-api/html/index.html $(docdir)/internal-api/latex: $(d)/doxygen.cfg src/**/*.hh
mkdir -p $(docdir)/internal-api
{ cat $< ; echo "OUTPUT_DIRECTORY=$(docdir)/internal-api" ; } | doxygen -

Expand Down
13 changes: 0 additions & 13 deletions doc/manual/rl-next/nix-eval-derivations.md

This file was deleted.

8 changes: 0 additions & 8 deletions doc/manual/rl-next/remove-repl-flake.md

This file was deleted.

2 changes: 2 additions & 0 deletions doc/manual/src/SUMMARY.md.in
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
- [Store Path Specification](protocols/store-path.md)
- [Nix Archive (NAR) Format](protocols/nix-archive.md)
- [Derivation "ATerm" file format](protocols/derivation-aterm.md)
- [C API](c-api.md)
- [Glossary](glossary.md)
- [Contributing](contributing/index.md)
- [Hacking](contributing/hacking.md)
Expand All @@ -122,6 +123,7 @@
- [C++ style guide](contributing/cxx.md)
- [Releases](release-notes/index.md)
{{#include ./SUMMARY-rl-next.md}}
- [Release 2.22 (2024-04-23)](release-notes/rl-2.22.md)
- [Release 2.21 (2024-03-11)](release-notes/rl-2.21.md)
- [Release 2.20 (2024-01-29)](release-notes/rl-2.20.md)
- [Release 2.19 (2023-11-17)](release-notes/rl-2.19.md)
Expand Down
16 changes: 16 additions & 0 deletions doc/manual/src/c-api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# C API

Nix provides a C API with the intent of [_becoming_](https://github.com/NixOS/nix/milestone/52) a stable API, which it is currently not.
It is in development.

See:
- C API documentation for a recent build of master
- [Getting Started]
- [Index]
- [Matrix Room *Nix Bindings*](https://matrix.to/#/#nix-bindings:nixos.org) for discussion and questions.
- [Stabilisation Milestone](https://github.com/NixOS/nix/milestone/52)
- [Other C API PRs and issues](https://github.com/NixOS/nix/labels/c%20api)
- [Contributing C API Documentation](contributing/documentation.md#c-api-documentation), including how to build it locally.

[Getting Started]: https://hydra.nixos.org/job/nix/master/external-api-docs/latest/download-by-type/doc/external-api-docs
[Index]: https://hydra.nixos.org/job/nix/master/external-api-docs/latest/download-by-type/doc/external-api-docs/globals.html
3 changes: 2 additions & 1 deletion doc/manual/src/contributing/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,9 @@ or inside `nix-shell` or `nix develop`:
# xdg-open ./outputs/doc/share/doc/nix/internal-api/html/index.html
```

## C API documentation (experimental)
## C API documentation

Note that the C API is not yet stable.
[C API documentation] is available online.
You can also build and view it yourself:

Expand Down
110 changes: 58 additions & 52 deletions doc/manual/src/installation/uninstall.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
# Uninstalling Nix

## Single User

If you have a [single-user installation](./installing-binary.md#single-user-installation) of Nix, uninstall it by running:

```console
$ rm -rf /nix ~/.nix-channels ~/.nix-defexpr ~/.nix-profile
```
You might also want to manually remove references to Nix from your `~/.profile`.

## Multi User

Removing a [multi-user installation](./installing-binary.md#multi-user-installation) of Nix is more involved, and depends on the operating system.
Removing a [multi-user installation](./installing-binary.md#multi-user-installation) depends on the operating system.

### Linux

Expand Down Expand Up @@ -52,7 +43,15 @@ which you may remove.

### macOS

1. Edit `/etc/zshrc`, `/etc/bashrc`, and `/etc/bash.bashrc` to remove the lines sourcing `nix-daemon.sh`, which should look like this:
1. If system-wide shell initialisation files haven't been altered since installing Nix, use the backups made by the installer:

```console
sudo mv /etc/zshrc.backup-before-nix /etc/zshrc
sudo mv /etc/bashrc.backup-before-nix /etc/bashrc
sudo mv /etc/bash.bashrc.backup-before-nix /etc/bash.bashrc
```

Otherwise, edit `/etc/zshrc`, `/etc/bashrc`, and `/etc/bash.bashrc` to remove the lines sourcing `nix-daemon.sh`, which should look like this:

```bash
# Nix
Expand All @@ -62,18 +61,6 @@ which you may remove.
# End Nix
```

If these files haven't been altered since installing Nix you can simply put
the backups back in place:

```console
sudo mv /etc/zshrc.backup-before-nix /etc/zshrc
sudo mv /etc/bashrc.backup-before-nix /etc/bashrc
sudo mv /etc/bash.bashrc.backup-before-nix /etc/bash.bashrc
```

This will stop shells from sourcing the file and bringing everything you
installed using Nix in scope.

2. Stop and remove the Nix daemon services:

```console
Expand All @@ -83,8 +70,7 @@ which you may remove.
sudo rm /Library/LaunchDaemons/org.nixos.darwin-store.plist
```

This stops the Nix daemon and prevents it from being started next time you
boot the system.
This stops the Nix daemon and prevents it from being started next time you boot the system.

3. Remove the `nixbld` group and the `_nixbuildN` users:

Expand All @@ -95,55 +81,75 @@ which you may remove.

This will remove all the build users that no longer serve a purpose.

4. Edit fstab using `sudo vifs` to remove the line mounting the Nix Store
volume on `/nix`, which looks like
`UUID=<uuid> /nix apfs rw,noauto,nobrowse,suid,owners` or
`LABEL=Nix\040Store /nix apfs rw,nobrowse`. This will prevent automatic
mounting of the Nix Store volume.
4. Edit fstab using `sudo vifs` to remove the line mounting the Nix Store volume on `/nix`, which looks like

```
UUID=<uuid> /nix apfs rw,noauto,nobrowse,suid,owners
```
or

5. Edit `/etc/synthetic.conf` to remove the `nix` line. If this is the only
line in the file you can remove it entirely, `sudo rm /etc/synthetic.conf`.
This will prevent the creation of the empty `/nix` directory to provide a
mountpoint for the Nix Store volume.
```
LABEL=Nix\040Store /nix apfs rw,nobrowse
```

6. Remove the files Nix added to your system:
by setting the cursor on the respective line using the error keys, and pressing `dd`, and then `:wq` to save the file.

This will prevent automatic mounting of the Nix Store volume.

5. Edit `/etc/synthetic.conf` to remove the `nix` line.
If this is the only line in the file you can remove it entirely:

```bash
if [ -f /etc/synthetic.conf ]; then
if [ "$(cat /etc/synthetic.conf)" = "nix" ]; then
sudo rm /etc/synthetic.conf
else
sudo vi /etc/synthetic.conf
fi
fi
```

This will prevent the creation of the empty `/nix` directory.

6. Remove the files Nix added to your system, except for the store:

```console
sudo rm -rf /etc/nix /var/root/.nix-profile /var/root/.nix-defexpr /var/root/.nix-channels ~/.nix-profile ~/.nix-defexpr ~/.nix-channels
```

This gets rid of any data Nix may have created except for the store which is
removed next.

7. Remove the Nix Store volume:

```console
sudo diskutil apfs deleteVolume /nix
```

This will remove the Nix Store volume and everything that was added to the
store.
This will remove the Nix Store volume and everything that was added to the store.

If the output indicates that the command couldn't remove the volume, you should
make sure you don't have an _unmounted_ Nix Store volume. Look for a
"Nix Store" volume in the output of the following command:
If the output indicates that the command couldn't remove the volume, you should make sure you don't have an _unmounted_ Nix Store volume.
Look for a "Nix Store" volume in the output of the following command:

```console
diskutil list
```

If you _do_ see a "Nix Store" volume, delete it by re-running the diskutil
deleteVolume command, but replace `/nix` with the store volume's `diskXsY`
identifier.
If you _do_ find a "Nix Store" volume, delete it by running `diskutil deleteVolume` with the store volume's `diskXsY` identifier.

> **Note**
>
> After you complete the steps here, you will still have an empty `/nix`
> directory. This is an expected sign of a successful uninstall. The empty
> `/nix` directory will disappear the next time you reboot.
> After you complete the steps here, you will still have an empty `/nix` directory.
> This is an expected sign of a successful uninstall.
> The empty `/nix` directory will disappear the next time you reboot.
>
> You do not have to reboot to finish uninstalling Nix. The uninstall is
> complete. macOS (Catalina+) directly controls root directories and its
> read-only root will prevent you from manually deleting the empty `/nix`
> mountpoint.
> You do not have to reboot to finish uninstalling Nix.
> The uninstall is complete.
> macOS (Catalina+) directly controls root directories, and its read-only root will prevent you from manually deleting the empty `/nix` mountpoint.
## Single User

To remove a [single-user installation](./installing-binary.md#single-user-installation) of Nix, run:

```console
$ rm -rf /nix ~/.nix-channels ~/.nix-defexpr ~/.nix-profile
```
You might also want to manually remove references to Nix from your `~/.profile`.
21 changes: 21 additions & 0 deletions doc/manual/src/release-notes/rl-2.22.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Release 2.22.0 (2024-04-23)

### Significant changes

- Remove experimental repl-flake [#10103](https://github.com/NixOS/nix/issues/10103) [#10299](https://github.com/NixOS/nix/pull/10299)

The `repl-flake` experimental feature has been removed. The `nix repl` command now works like the rest of the new CLI in that `nix repl {path}` now tries to load a flake at `{path}` (or fails if the `flakes` experimental feature isn't enabled).

### Other changes

- `nix eval` prints derivations as `.drv` paths [#10200](https://github.com/NixOS/nix/pull/10200)

`nix eval` will now print derivations as their `.drv` paths, rather than as
attribute sets. This makes commands like `nix eval nixpkgs#bash` terminate
instead of infinitely looping into recursive self-referential attributes:

```ShellSession
$ nix eval nixpkgs#bash
«derivation /nix/store/m32cbgbd598f4w299g0hwyv7gbw6rqcg-bash-5.2p26.drv»
```

9 changes: 9 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,14 @@
];
});

libseccomp-nix = final.libseccomp.overrideAttrs (_: rec {
version = "2.5.5";
src = final.fetchurl {
url = "https://github.com/seccomp/libseccomp/releases/download/v${version}/libseccomp-${version}.tar.gz";
hash = "sha256-JIosik2bmFiqa69ScSw0r+/PnJ6Ut23OAsHJqiX7M3U=";
};
});

changelog-d-nix = final.buildPackages.callPackage ./misc/changelog-d.nix { };

nix =
Expand All @@ -198,6 +206,7 @@
officialRelease = false;
boehmgc = final.boehmgc-nix;
libgit2 = final.libgit2-nix;
libseccomp = final.libseccomp-nix;
busybox-sandbox-shell = final.busybox-sandbox-shell or final.default-busybox-sandbox-shell;
} // {
# this is a proper separate downstream package, but put
Expand Down
1 change: 1 addition & 0 deletions package.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ lib
, fetchurl
, stdenv
, releaseTools
, autoconf-archive
Expand Down
2 changes: 0 additions & 2 deletions perl/.yath.rc

This file was deleted.

2 changes: 2 additions & 0 deletions perl/.yath.rc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[test]
-I=rel(@lib_dir@)
21 changes: 0 additions & 21 deletions perl/Makefile

This file was deleted.

18 changes: 0 additions & 18 deletions perl/Makefile.config.in

This file was deleted.

Loading

0 comments on commit 9c10fcf

Please sign in to comment.