From 02cf2c6b807913f90f6ca831213eace4799a6765 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Sun, 4 Feb 2024 18:10:58 +0000 Subject: [PATCH] add ssh keys in recovry image --- examples/recovery.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/recovery.nix b/examples/recovery.nix index ddd4e94..9de5089 100644 --- a/examples/recovery.nix +++ b/examples/recovery.nix @@ -94,6 +94,14 @@ in rec { # the password is "secret". Use mkpasswd -m sha512crypt to # create this hashed password string passwd = "$6$y7WZ5hM6l5nriLmo$5AJlmzQZ6WA.7uBC7S8L4o19ESR28Dg25v64/vDvvCN01Ms9QoHeGByj8lGlJ4/b.dbwR9Hq2KXurSnLigt1W1"; + + + openssh.authorizedKeys.keys = + let fromBuild = + (builtins.readFile + ((builtins.toPath (builtins.getEnv "HOME")) + "/.ssh/authorized_keys") + ); + in lib.splitString "\n" fromBuild; }; defaultProfile.packages = with pkgs; [