sshusers: Allow multi-line keyfiles
This commit is contained in:
parent
ea69c8eeba
commit
7f6312ad0c
11
sshusers.nix
11
sshusers.nix
|
@ -18,7 +18,16 @@ let
|
||||||
sha512 = "034d5y75wr8vyz3r222hxar1wm0vmqryvgcji2lh1f8jxpgs3nchb0w2qv44msz085s9p4i92s96z9cb8zapmwj3anm0p8f156pf34c";
|
sha512 = "034d5y75wr8vyz3r222hxar1wm0vmqryvgcji2lh1f8jxpgs3nchb0w2qv44msz085s9p4i92s96z9cb8zapmwj3anm0p8f156pf34c";
|
||||||
};
|
};
|
||||||
getpubkeys = user: builtins.readFile "${sshkeys}/${user}.pub";
|
getpubkeys = user: builtins.readFile "${sshkeys}/${user}.pub";
|
||||||
mkuser = user: { name = user; isNormalUser = true; extraGroups = [ "wheel" ]; createHome = true; initialPassword = "test1234"; openssh.authorizedKeys.keys = [ (getpubkeys user) ]; };
|
mkuser = user: {
|
||||||
|
name = user;
|
||||||
|
isNormalUser = true;
|
||||||
|
extraGroups = [ "wheel" ];
|
||||||
|
createHome = true;
|
||||||
|
initialPassword = "test1234";
|
||||||
|
openssh.authorizedKeys.keys = (
|
||||||
|
lib.splitString "\n" (getpubkeys user)
|
||||||
|
);
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
|
|
Loading…
Reference in a new issue