porthos: services: extract ssh-server

This commit is contained in:
Bruno BELANYI 2021-02-07 10:39:13 +00:00
parent 3b148ad684
commit 21747212dd
3 changed files with 26 additions and 7 deletions

23
services/ssh-server.nix Normal file
View file

@ -0,0 +1,23 @@
# An SSH server, using 'mosh'
{ config, lib, ... }:
let
cfg = config.my.services.ssh-server;
in
{
options.my.services.ssh-server = {
enable = lib.mkEnableOption "SSH Server using 'mosh'";
};
config = lib.mkIf cfg.enable {
services.openssh = {
# Enable the OpenSSH daemon.
enable = true;
# Be more secure
permitRootLogin = "no";
passwordAuthentication = false;
};
# Opens the relevant UDP ports.
programs.mosh.enable = true;
};
}