Unverified Commit 0af2c0b3 authored by K900's avatar K900 Committed by GitHub
Browse files

staging-nixos merge for 2026-02-06 (#487701)

parents 0123e560 8b47b408
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -15,13 +15,13 @@

stdenv.mkDerivation rec {
  pname = "dhcpcd";
  version = "10.2.4";
  version = "10.3.0";

  src = fetchFromGitHub {
    owner = "NetworkConfiguration";
    repo = "dhcpcd";
    rev = "v${version}";
    sha256 = "sha256-ysaKgF4Cu/S6yhSn/4glA0+Ey54KNp3/1Oh82yE0/PY=";
    sha256 = "sha256-XbXZkws1eHvN7OEq7clq2kziwwdk04lNrWbJ9RdHExU=";
  };

  nativeBuildInputs = [ pkg-config ];
+2 −2
Original line number Diff line number Diff line
@@ -31,11 +31,11 @@ let
in
stdenv.mkDerivation rec {
  pname = "nano";
  version = "8.7";
  version = "8.7.1";

  src = fetchurl {
    url = "mirror://gnu/nano/${pname}-${version}.tar.xz";
    hash = "sha256-r9KHqmcsSLjhqT/bbGWIRT1SdRDZZoIraH8oNfDZhuk=";
    hash = "sha256-dvDcskjy4vElHU7NIP0w+0AKNgo6N8bDQOClLC0c3t8=";
  };

  nativeBuildInputs = [ texinfo ] ++ lib.optional enableNls gettext;
+6 −0
Original line number Diff line number Diff line
@@ -272,6 +272,9 @@ It must be one of the following:
	When set, *nixos-rebuild* prefixes activation commands with sudo.
	Setting this option allows deploying as a non-root user.

	You can set sudo options by defining the NIX_SUDOOPTS environment
	variable.

*--ask-sudo-password*, *-S*
	When set, *nixos-rebuild* will ask for sudo password for remote
	activation (i.e.: on *--target-host*) at the start of the build process.
@@ -339,6 +342,9 @@ NIX_PATH
NIX_SSHOPTS
	Additional options to be passed to ssh on the command line.

NIX_SUDOOPTS
	Additional options to be passed to sudo on the command line.

# FILES

/etc/nixos/flake.nix
+2 −1
Original line number Diff line number Diff line
@@ -142,7 +142,8 @@ def run_wrapper(
        if extra_env:
            env = os.environ | extra_env
        if sudo:
            run_args = ["sudo", *run_args]
            sudo_args = shlex.split(os.getenv("NIX_SUDOOPTS", ""))
            run_args = ["sudo", *sudo_args, *run_args]

    logger.debug(
        "calling run with args=%r, kwargs=%r, extra_env=%r",
+18 −0
Original line number Diff line number Diff line
@@ -160,3 +160,21 @@ def test_ssh_host() -> None:
        remote = m.Remote.from_arg(host_input, None, False)
        assert remote is not None
        assert remote.ssh_host() == expected


@patch("subprocess.run", autospec=True)
def test_custom_sudo_args(mock_run: Any) -> None:
    with patch.dict(p.os.environ, {"NIX_SUDOOPTS": "--custom sudo --args"}):
        p.run_wrapper(
            ["test"],
            check=False,
            sudo=True,
        )
    mock_run.assert_called_with(
        ["sudo", "--custom", "sudo", "--args", "test"],
        check=False,
        env=None,
        input=None,
        text=True,
        errors="surrogateescape",
    )
Loading