Skip to content

Commit

Permalink
Add missing user-vms ssh_public_key option
Browse files Browse the repository at this point in the history
  • Loading branch information
diamondburned committed May 3, 2024
1 parent ba2930c commit 1da4220
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions user-machines/vm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
Expand Down
2 changes: 1 addition & 1 deletion user-machines/vm/ubuntu-cloud-init.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
})
)
Expand Down

0 comments on commit 1da4220

Please sign in to comment.