drop deploy_as_root check

We haven't documented macOS support yet, so I don't expect many people
using it yet. Now that the pull request is merged probably most people
starting with darwin-nix will be on that commit anyway, so it's not
worth the check, given that the sudo version doesn't work very well.
This commit is contained in:
Jörg Thalheim
2025-05-19 12:09:08 +02:00
parent 6c42baca23
commit 494ea192e7
2 changed files with 2 additions and 29 deletions

View File

@@ -109,11 +109,6 @@ def deploy_machine(machine: Machine) -> None:
target_host = stack.enter_context(machine.target_host())
build_host = stack.enter_context(machine.build_host())
if machine._class_ == "darwin":
if not machine.deploy_as_root and target_host.user == "root":
msg = f"'targetHost' should be set to a non-root user for deploying to nix-darwin on machine '{machine.name}'"
raise ClanError(msg)
host = build_host or target_host
generate_facts([machine], service=None, regenerate=False)
@@ -138,7 +133,7 @@ def deploy_machine(machine: Machine) -> None:
f"{path}#{machine.name}",
]
become_root = machine.deploy_as_root
become_root = True
if machine._class_ == "nixos":
nix_options += [