NixOps 2.0 self SSH?

I currently have NixOps 2.0 (Master) installed on my Mac.

My configuration file is:

{
  network = {
    description = "sylent";
    enableRollback = true;
  };

  apollo = {
    imports = [ ./machines/apollo/configuration.nix ];

    deployment = {
      targetHost = "10.0.1.2";
      hasFastConnection = true;
    };

    nixpkgs.localSystem.system = "x86_64-linux";
  };
}

This is great, and it works, but I want to manage my SSH keys to this server instead of having NixOps generate one and store it somewhere.

If I add this configuration option to the above:

deployment.provisionSSHKey = false;

I get an error saying do not know private SSH key for machine 'apollo'. Still pretty new to Nix and comfortable enough to read the source code of NixOps to determine configuration options that might not be full documented yet or have examples, but for the life of me I can’t figure out how to get this to work. Do I need to set options like sshPrivateKey, sshPublicKey somewhere? Will it pick up my SSH config on my Mac ~/.ssh/config?

In plain old shell I can call ssh 10.0.1.2 and my config is picked up perfectly by the SSH agent, so I don’t think it is an issue there.

Any help would be greatly appreciated!

3 Likes