Hi, given this flake:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
nixos-generators.url = "github:nix-community/nixos-generators";
nixos-generators.inputs.nixpkgs.follows = "nixpkgs";
deploy-rs.url = "github:serokell/deploy-rs";
deploy-rs.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, nixos-generators, deploy-rs, ...}:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
base-module =
{ modulesPath, ... }: {
imports = [
"${modulesPath}/profiles/headless.nix"
"${modulesPath}/profiles/minimal.nix"
];
nix.settings.trusted-users = ["root" "admin"];
security.sudo.wheelNeedsPassword = false;
system.stateVersion = "23.05";
networking.firewall.allowedTCPPorts = [ 22 ];
services.openssh.enable = true;
users.users.admin = {
home = "/home/admin";
isNormalUser = true;
extraGroups = [ "wheel" ];
password = "topsecret";
openssh.authorizedKeys.keys = ["insert-your-own"];
};
};
qemu-module =
{ modulesPath, ... }: {
imports = [
"${modulesPath}/profiles/qemu-guest.nix"
"${modulesPath}/virtualisation/qemu-vm.nix"
];
virtualisation.forwardPorts = [{ from = "host"; host.port = 2022; guest.port = 22; }];
virtualisation.graphics = false;
};
## base vm for testing with qemu
base-vm = nixos-generators.nixosGenerate {
inherit pkgs;
format = "vm";
modules = [
base-module
qemu-module
];
};
in
{
packages.${system}.base-vm = base-vm;
nixosConfigurations.my-machine = nixpkgs.lib.nixosSystem {
system = system;
modules = [ base-module qemu-module ];
};
deploy = {
nodes.my-machine = {
hostname = "localhost";
profiles.system = {
user = "root";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.my-machine;
sshUser = "admin";
sshOpts = ["-p" "2022"];
};
};
remoteBuild = false;
};
};
}
I can run the vm using nix run .#base-vm
and log into it. When I try to update it with deploy-rs, it fails though.
nix run github:serokell/deploy-rs .
🚀 ℹ [deploy] [INFO] Running checks for flake in .
warning: unknown flake output 'deploy'
🚀 ℹ [deploy] [INFO] Evaluating flake in .
🚀 ℹ [deploy] [INFO] The following profiles are going to be deployed:
[my-machine.system]
user = "root"
ssh_user = "admin"
path = "/nix/store/y7rk7x3lp7d89l5412s4d7zm9a301ww2-activatable-nixos-system-nixos-23.05.20230826.f155f0c"
hostname = "localhost"
ssh_opts = ["-p", "2022"]
🚀 ℹ [deploy] [INFO] Building profile `system` for node `my-machine`
🚀 ℹ [deploy] [INFO] Copying profile `system` to node `my-machine`
copying path '/nix/store/ryi0fnk7ayz2kyvhz5623kpghd8xn6ys-extra-utils' from 'https://cache.nixos.org'...
copying path '/nix/store/2a6an5jbjl90934y5gdjbpr3dr9cmjv4-dbus-1.14.8-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/k2i4nh36xl0sll6wslnjasd4bxg7q4c0-hwdb.bin' from 'https://cache.nixos.org'...
copying path '/nix/store/55v99x034sb1gy6kqyqk8s1dbd50ifdr-dbus-1.14.8' from 'https://cache.nixos.org'...
copying path '/nix/store/x9jml0nr4jp754ibhhasv7rbwyghdirz-initrd-kmod-blacklist-ubuntu' from 'https://cache.nixos.org'...
copying path '/nix/store/mpjz7zqfx91pw4jbi24jh80qn8dz62p7-mdadm.conf' from 'https://cache.nixos.org'...
copying path '/nix/store/zfalp58vlb2dsljxqqfc7cn5c67ja077-system-generators' from 'https://cache.nixos.org'...
copying path '/nix/store/86qn0n0vchjg9fajm38cf9qc83ykd3i6-udev-rules' from 'https://cache.nixos.org'...
copying path '/nix/store/6yagjpj3ygwv3xd5vrpp0nrrkglh0hfm-util-linux-2.38.1-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/ksp9bw1sdy4jbjzlwil1pq0yljkka742-bcache-tools-1.0.7' from 'https://cache.nixos.org'...
copying path '/nix/store/6sa0v1a6fwdklni3zvqwnwy2r6mxmxmz-util-linux-2.38.1-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/jz409gpbgwzg9vc63zjcny1g5ph33nx7-install-grub.pl' from 'https://cache.nixos.org'...
copying path '/nix/store/rq1qlmkq4rq1p7gdgqsvivlf9csff00z-mdadm-4.2' from 'https://cache.nixos.org'...
copying path '/nix/store/anbrwmcd3q24zl0qkyhq5393smg8g88f-mount-pstore.sh' from 'https://cache.nixos.org'...
copying path '/nix/store/742lrqdx648gr2f8vjsz4asqma4nvbav-X-Restart-Triggers' from 'https://cache.nixos.org'...
copying path '/nix/store/slmgfnagn2zcz71kidv3j7c0cwfr65c7-nixos-container' from 'https://cache.nixos.org'...
copying path '/nix/store/2pq81bx8jzbf7axks17715k7p16kphd3-system-shutdown' from 'https://cache.nixos.org'...
copying path '/nix/store/fmac0p82n8553wrjs62l9sdvkx7c3w5s-reload-container' from 'https://cache.nixos.org'...
copying path '/nix/store/lq9giy0220fgrfi5qkig685apjizlrar-udev-path' from 'https://cache.nixos.org'...
copying path '/nix/store/35w03b6s99w4mc6vryzldhwzp2l1fj3z-unit-container-.service' from 'https://cache.nixos.org'...
copying path '/nix/store/ndax3lzxg3mx6qzgf5xv7fs0gjv33g1c-udev-rules' from 'https://cache.nixos.org'...
copying path '/nix/store/gwxhk0n6aclh5xgf56d5dzric8vc562k-unit-container-getty-.service' from 'https://cache.nixos.org'...
copying path '/nix/store/0nd98adk12yrfzhw0h2ia2m2l4dbh16w-unit-getty-.service' from 'https://cache.nixos.org'...
copying path '/nix/store/yh26gvlj3pfb7gr52nha34glg1sak0d0-unit-mount-pstore.service' from 'https://cache.nixos.org'...
copying path '/nix/store/mwr0bmf5qvgip0abfrpg1nq5c2l85wab-unit-save-hwclock.service' from 'https://cache.nixos.org'...
copying path '/nix/store/aynyrqxfgfkl9h05db30vv91hqvpgfhb-unit-script-nixos-activation-start' from 'https://cache.nixos.org'...
copying path '/nix/store/207180ziyk5nmqh8nvgkv77cc58dy5wg-unit-serial-getty-.service' from 'https://cache.nixos.org'...
copying path '/nix/store/qllpjbmbqlbmrbwnbj7rvq6inijmfs1f-unit-nixos-activation.service' from 'https://cache.nixos.org'...
copying path '/nix/store/kyms9hzlflxaz38ncv940qggnald1ij6-unit-systemd-udevd.service' from 'https://cache.nixos.org'...
🚀 ℹ [deploy] [INFO] Activating profile `system` for node `my-machine`
🚀 ℹ [deploy] [INFO] Creating activation waiter
⭐ ℹ [activate] [INFO] Activating profile
👀 ℹ [wait] [INFO] Waiting for confirmation event...
updating GRUB 2 menu...
installing the GRUB 2 boot loader on /dev/vda...
Installing for i386-pc platform.
/nix/store/lcx4m4x9xhkbh2h57f53s879fa0dc7q4-grub-2.06/sbin/grub-install: warning: File system `ext2' doesn't support embedding.
/nix/store/lcx4m4x9xhkbh2h57f53s879fa0dc7q4-grub-2.06/sbin/grub-install: warning: Embedding is not possible. GRUB can only be installed in this setup by .
/nix/store/lcx4m4x9xhkbh2h57f53s879fa0dc7q4-grub-2.06/sbin/grub-install: error: will not proceed with blocklists.
/nix/store/jz409gpbgwzg9vc63zjcny1g5ph33nx7-install-grub.pl: installation of GRUB on /dev/vda failed: No such file or directory
⭐ ⚠ [activate] [WARN] De-activating due to error
error: no profile version older than the current (1) exists
⭐ ❌ [activate] [ERROR] There was an error de-activating after an error was encountered: The rollback resulted in a bad exit code: Some(1)
🚀 ❌ [deploy] [ERROR] Activating over SSH resulted in a bad exit code: Some(1)
🚀 ℹ [deploy] [INFO] Revoking previous deploys
🚀 ❌ [deploy] [ERROR] Deployment failed, rolled back to previous generation
Does anyone know what I am doing wrong?