serokell / deploy-rs

A simple multi-profile Nix-flake deploy tool.
Other
1.42k stars 101 forks source link

cannot add path '/nix/store/...l' because it lacks a signature by a trusted key #280

Closed munnik closed 4 months ago

munnik commented 4 months ago

Hi,

I'm pretty new to Nix and NixOS and trying out deploy-rs to deploy a configuration to a remote server. When I run deploy-rs I get the error below. No sure how to solve this.

$ nix run github:serokell/deploy-rs .
🚀 ℹ️ [deploy] [INFO] Running checks for flake in .
warning: Git tree '/home/munnik/Code/nixos-anywhere' is dirty
warning: unknown flake output 'deploy'
warning: unknown flake output 'fastConnection'
warning: The check omitted these incompatible systems: aarch64-darwin, aarch64-linux, x86_64-darwin
Use '--all-systems' to check all.
🚀 ℹ️ [deploy] [INFO] Evaluating flake in .
warning: Git tree '/home/munnik/Code/nixos-anywhere' is dirty
🚀 ℹ️ [deploy] [INFO] The following profiles are going to be deployed:
[hetzner.system]
user = "root"
ssh_user = "munnik"
path = "/nix/store/vszg5ylacaccyqmrdxicj67x835r3h94-activatable-nixos-system-nixos-24.05.20240701.d032c1a"
hostname = "123.45.67.89"
ssh_opts = []

🚀 ℹ️ [deploy] [INFO] Building profile `system` for node `hetzner`
🚀 ℹ️ [deploy] [INFO] Copying profile `system` to node `hetzner`
Enter passphrase for key '/home/munnik/.ssh/id_rsa': 
[1/0/21 copied (0.0/0.2 MiB)] copying path '/nix/store/xb1x5frlqwmxx3l5kawps0y7s6877d3r-jail.local' to 'ssh://munnik@123.45.67.89'error: cannot add path '/nix/store/xb1x5frlqwmxx3l5kawps0y7s6877d3r-jail.local' because it lacks a signature by a trusted key
error (ignored): error: unexpected end-of-file
error: unexpected end-of-file
🚀 ❌ [deploy] [ERROR] Failed to push profile to node hetzner: hetzner
munnik commented 4 months ago

Setting nix.settings.trusted-users in configuration.nix solved this issue.

lenianiva commented 2 months ago

Setting nix.settings.trusted-users in configuration.nix solved this issue.

so you just have to set nix.settings.trusted-users = ["root" "@wheel"] in the deployed configuration (nixosConfigurations.${profile}.modules) for the error to resolve?