Colmena connects with BatchMode=yes and no TTY (src/nix/host/ssh.rs),
so a sudo password prompt can never be answered - non-root deploys
REQUIRE NOPASSWD. New extraServices.colmenaDeploy (enabled on all
five hosts) grants m3tam3re passwordless sudo for exactly the two
invocations colmena performs (verified against colmena 0.5/0.6
profile.rs + host/{ssh,local}.rs, default NixFlags are empty):
- /run/current-system/sw/bin/nix-env --profile /nix/var/nix/profiles/system --set /nix/store/*
(system profile switch, goals switch/boot)
- /nix/store/*/bin/switch-to-configuration <boot|switch|test|dry-activate>
(activation, exact single argument)
Everything else keeps requiring the sudo password; extraRules sort
after the wheel rules, so last-match-wins keeps the exception scoped.
Also enables passwordless 'colmena apply-local' on the desktops, which
uses the same activation path.
Residual risk (documented in the module): anyone holding the deploy
user's SSH key can activate arbitrary store closures - that is the
deploy capability itself, inherent to NixOS remote activation.
One-time bootstrap per server (rules arrive WITH a deploy, and the
first deploy cannot answer a password prompt):
nixos-rebuild switch --flake .#m3-atlas --target-host m3tam3re@m3-atlas --use-remote-sudo
10 lines
125 B
Nix
10 lines
125 B
Nix
{
|
|
imports = [
|
|
./colmena-deploy.nix
|
|
./flatpak.nix
|
|
./podman.nix
|
|
./ollama.nix
|
|
./virtualisation.nix
|
|
];
|
|
}
|