Merge pull request #210382 from B4dM4n/nixos-rebuild-local

nixos-rebuild: Allow local builds when --target-host is used again
This commit is contained in:
Nick Cao 2023-01-23 16:37:41 +08:00 committed by GitHub
commit 3cd694d1bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 7 deletions

View file

@ -348,6 +348,15 @@
been changed to <literal>null</literal>.
</para>
</listitem>
<listitem>
<para>
The <literal>--target-host</literal> and
<literal>--build-host</literal> options of
<literal>nixos-rebuild</literal> no longer treat the
<literal>localhost</literal> value specially to build
on/deploy to local machine, omit the relevant flag.
</para>
</listitem>
<listitem>
<para>
The <literal>nix.readOnlyStore</literal> option has been

View file

@ -583,15 +583,15 @@
<listitem>
<para>
Specifies the NixOS target host. By setting this to something other than
<replaceable>localhost</replaceable>, the system activation will happen
an empty string, the system activation will happen
on the remote host instead of the local machine. The remote host needs to
be accessible over ssh, and for the commands <option>switch</option>,
<option>boot</option> and <option>test</option> you need root access.
</para>
<para>
If <option>--build-host</option> is not explicitly specified, building
will take place locally.
If <option>--build-host</option> is not explicitly specified or empty,
building will take place locally.
</para>
<para>

View file

@ -85,6 +85,8 @@ In addition to numerous new and upgraded packages, this release has the followin
- In `mastodon` it is now necessary to specify location of file with `PostgreSQL` database password. In `services.mastodon.database.passwordFile` parameter default value `/var/lib/mastodon/secrets/db-password` has been changed to `null`.
- The `--target-host` and `--build-host` options of `nixos-rebuild` no longer treat the `localhost` value specially to build on/deploy to local machine, omit the relevant flag.
- The `nix.readOnlyStore` option has been renamed to `boot.readOnlyNixStore` to clarify that it configures the NixOS boot process, not the Nix daemon.
- Deprecated `xlibsWrapper` transitional package has been removed in favour of direct use of its constitutents: `xorg.libX11`, `freetype` and others.

View file

@ -157,10 +157,6 @@ if [[ -n "$SUDO_USER" || -n $remoteSudo ]]; then
maybeSudo=(sudo --preserve-env="$preservedSudoVars" --)
fi
if [[ -z "$buildHost" && -n "$targetHost" ]]; then
buildHost="$targetHost"
fi
# log the given argument to stderr if verbose mode is on
logVerbose() {
if [ -n "$verboseScript" ]; then