iso: set admin keys for nixos user, too

This commit is contained in:
Sandro - 2023-05-21 20:58:25 +02:00
parent e2d88bdc80
commit 5a6de46dff
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5
1 changed files with 7 additions and 0 deletions

View File

@ -104,6 +104,13 @@ in
openssh.authorizedKeys.keys = adminKeys;
};
# TODO: change when on 23.05
# https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/profiles/installation-device.nix#L23
# nixos = lib.mkIf (config.system.nixos.variant_id == "installer") { openssh.authorizedKeys.keys = adminKeys; };
# using proxy option to detect iso
# https://github.com/NixOS/nixpkgs/blob/nixos-22.11/nixos/modules/profiles/installation-device.nix#L48
nixos = lib.mkIf (config.services.getty.autologinUser == "nixos") { openssh.authorizedKeys.keys = adminKeys; };
root.openssh.authorizedKeys.keys = adminKeys;
};
};