mirror of
https://github.com/nmasur/dotfiles
synced 2024-12-25 05:24:52 +00:00
add sshd for aws generators
This commit is contained in:
parent
50a538c78e
commit
9e3345ff9b
@ -11,9 +11,12 @@ nixos-generators.nixoGenerate {
|
||||
colorscheme = (import ../../modules/colorscheme/gruvbox);
|
||||
passwordHash =
|
||||
"$6$PZYiMGmJIIHAepTM$Wx5EqTQ5GApzXx58nvi8azh16pdxrN6Qrv1wunDlzveOgawitWzcIxuj76X9V868fsPi/NOIEO8yVXqwzS9UF.";
|
||||
publicKey =
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s";
|
||||
}
|
||||
../hosts/common.nix
|
||||
../modules/nixos
|
||||
../modules/services/sshd.nix
|
||||
];
|
||||
format = "aws";
|
||||
}
|
||||
|
24
modules/services/sshd.nix
Normal file
24
modules/services/sshd.nix
Normal file
@ -0,0 +1,24 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
|
||||
options = {
|
||||
publicKey = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Public SSH key authorized for this system.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
ports = [ 22 ];
|
||||
passwordAuthentication = false;
|
||||
gatewayPorts = "no";
|
||||
forwardX11 = false;
|
||||
allowSFTP = true;
|
||||
permitRootLogin = "no";
|
||||
};
|
||||
|
||||
users.users.${config.user}.authorizedKeys.keys = [ config.publicKey ];
|
||||
};
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user