Fix Ssh
This commit is contained in:
@@ -4,17 +4,17 @@ let
|
|||||||
groupedUsers = lib.groupBy (u: u.username) allUsers;
|
groupedUsers = lib.groupBy (u: u.username) allUsers;
|
||||||
allowedUsernames = map (u: u.username) config.syscfg.users;
|
allowedUsernames = map (u: u.username) config.syscfg.users;
|
||||||
activeUsers = lib.filterAttrs (name: _: lib.elem name allowedUsernames) groupedUsers;
|
activeUsers = lib.filterAttrs (name: _: lib.elem name allowedUsernames) groupedUsers;
|
||||||
|
|
||||||
in {
|
in {
|
||||||
imports = [ ./hardware.nix ];
|
imports = [ ./hardware.nix ];
|
||||||
|
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
services.openssh.ports = [ 422 ];
|
services.openssh.ports = [ 422 ];
|
||||||
|
services.openssh.extraConfig = activeUsers;#[ 422 ];
|
||||||
users.users = lib.mapAttrs (name: userList: {
|
users.users = lib.mapAttrs (name: userList: {
|
||||||
openssh.authorizedKeys.keys = lib.unique (
|
openssh.authorizedKeys.keys = lib.unique (
|
||||||
lib.concatMap (u: if u ? pubssh then [ u.pubssh ] else []) userList
|
lib.concatMap (u: if u ? pubssh then [ u.pubssh ] else []) userList
|
||||||
);
|
);
|
||||||
}) groupedUsers
|
}) activeUsers
|
||||||
// {
|
// {
|
||||||
root = {openssh.authorizedKeys.keys = [];};
|
root = {openssh.authorizedKeys.keys = [];};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user