From 1da4220c9312e2e8b96fb1a25b02f6a4d3a6d089 Mon Sep 17 00:00:00 2001 From: diamondburned Date: Fri, 3 May 2024 03:24:57 -0700 Subject: [PATCH] Add missing user-vms ssh_public_key option --- user-machines/vm/default.nix | 5 +++++ user-machines/vm/ubuntu-cloud-init.nix | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/user-machines/vm/default.nix b/user-machines/vm/default.nix index cae3cd2..35d36ff 100644 --- a/user-machines/vm/default.nix +++ b/user-machines/vm/default.nix @@ -79,6 +79,11 @@ in type = types.str; description = "The default password for the user."; }; + ssh_public_key = mkOption { + type = types.nullOr types.str; + default = null; + description = "The SSH public key for the user."; + }; uuid = mkOption { type = types.str; description = "The UUID of the user."; diff --git a/user-machines/vm/ubuntu-cloud-init.nix b/user-machines/vm/ubuntu-cloud-init.nix index 6e6c823..4882f5a 100644 --- a/user-machines/vm/ubuntu-cloud-init.nix +++ b/user-machines/vm/ubuntu-cloud-init.nix @@ -42,7 +42,7 @@ let lock_passwd = false; plain_text_passwd = user.default_password; } // - (lib.optionalAttrs (user ? "ssh_public_key" && user.ssh_public_key != null) { + (lib.optionalAttrs (user.ssh_public_key != null) { ssh_authorized_keys = user.ssh_keys; }) )