···55something](#ch-configuration) in that file, you should do
6677```ShellSession
88-# nixos-rebuild switch
88+$ nixos-rebuild switch --use-remote-sudo
99```
10101111-to build the new configuration, make it the default configuration for
1212-booting, and try to realise the configuration in the running system
1313-(e.g., by restarting system services).
1111+to build the new configuration as your current user, and as the root user,
1212+make it the default configuration for booting. `switch` will also try to
1313+realise the configuration in the running system (e.g., by restarting system
1414+services).
14151516::: {.warning}
1617This command doesn't start/stop [user services](#opt-systemd.user.services)
···1920:::
20212122::: {.warning}
2222-These commands must be executed as root, so you should either run them
2323-from a root shell or by prefixing them with `sudo -i`.
2323+Applying a configuration is an action that must be done by the root user, so the
2424+`switch`, `boot` and `test` commands should be ran with the `--use-remote-sudo`
2525+flag. Despite its odd name, this flag runs the activation script with elevated
2626+permissions, regardless of whether or not the target system is remote, without
2727+affecting the other stages of the `nixos-rebuild` call. This allows unprivileged
2828+users to rebuild the system and only elevate their permissions when necessary.
2929+3030+Alternatively, one can run the whole command as root while preserving user
3131+environment variables by prefixing the command with `sudo -E`. However, this
3232+method may create root-owned files in `$HOME/.cache` if Nix decides to use the
3333+cache during evaluation.
2434:::
25352636You can also do
27372838```ShellSession
2929-# nixos-rebuild test
3939+$ nixos-rebuild test --use-remote-sudo
3040```
31413242to build the configuration and switch the running system to it, but
···3747There is also
38483949```ShellSession
4040-# nixos-rebuild boot
5050+$ nixos-rebuild boot --use-remote-sudo
4151```
42524353to build the configuration and make it the boot default, but not switch
···4757GRUB 2 boot screen by giving it a different *profile name*, e.g.
48584959```ShellSession
5050-# nixos-rebuild switch -p test
6060+$ nixos-rebuild switch -p test --use-remote-sudo
5161```
52625363which causes the new configuration (and previous ones created using
···5868A repl, or read-eval-print loop, is also available. You can inspect your configuration and use the Nix language with
59696070```ShellSession
6161-# nixos-rebuild repl
7171+$ nixos-rebuild repl
6272```
63736474Your configuration is loaded into the `config` variable. Use tab for autocompletion, use the `:r` command to reload the configuration files. See `:?` or [`nix repl` in the Nix manual](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-repl.html) to learn more.
···483483 pytest-pep8 = pytestpep8; # added 2021-01-04
484484 pytest-pep257 = throw "pytest-pep257 was removed, as the pep257 package was migrated into pycodestyle"; # added 2022-04-12
485485 pytest-pythonpath = throw "pytest-pythonpath is obsolete as of pytest 7.0.0 and has been removed"; # added 2022-03-09
486486+ pytest-runner = throw "pytest-runner has been removed as it uses deprecated features of setuptools and is deprecated by upstream"; # added 2024-09-15
486487 pytest-sanic = throw "pytest-sanic has been removed because it is unmaintained and broken"; # added 2023-06-22
487488 pytestpep8 = throw "pytestpep8 was removed because it is abandoned and no longer compatible with pytest v6.0"; # added 2020-12-10
488489 pytestquickcheck = pytest-quickcheck; # added 2021-07-20