global/nix: allow adding extra users to remotebuild
This commit is contained in:
parent
d481d06e6e
commit
725419bf74
1 changed files with 14 additions and 1 deletions
|
@ -12,6 +12,9 @@ let
|
|||
filterAttrs
|
||||
mapAttrs'
|
||||
;
|
||||
|
||||
authorizedKeysFiles =
|
||||
users: lib.concatStringsSep " " (map (u: "/etc/ssh/authorized_keys.d/${u}") users);
|
||||
in
|
||||
{
|
||||
nix = {
|
||||
|
@ -152,11 +155,21 @@ in
|
|||
description = "Unprivledged user for Nix remote builds";
|
||||
isSystemUser = true;
|
||||
shell = pkgs.bashInteractive;
|
||||
openssh.authorizedKeys.keys = config.users.users.root.openssh.authorizedKeys.keys;
|
||||
group = "remotebuild";
|
||||
};
|
||||
users.groups.remotebuild = { };
|
||||
|
||||
services.openssh.extraConfig = ''
|
||||
Match user remotebuild
|
||||
AuthorizedKeysFile ${
|
||||
authorizedKeysFiles [
|
||||
"infinidoge"
|
||||
"root"
|
||||
"%u"
|
||||
]
|
||||
}
|
||||
'';
|
||||
|
||||
nix.buildMachines = [
|
||||
{
|
||||
hostName = "infini-dl360";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue