Add vps-remote-access module

Signed-off-by: Magic_RB <magic_rb@redalder.org>
This commit is contained in:
Magic_RB 2021-07-31 13:24:30 +02:00
parent f0303cc19a
commit efe09476d8
No known key found for this signature in database
GPG key ID: 08D5287CC5DDCA0E

View file

@ -0,0 +1,25 @@
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.magic_rb.vpsRemoteAccess;
in
{
options.magic_rb = {
vpsRemoteAccess = {
enable = mkEnableOption "Enable VPS remote access module.";
trustedWheel = mkEnableOption "Add the wheel group to Nix trusted-users.";
};
};
config = mkIf cfg.enable
{
nix.trustedUsers = mkIf cfg.trustedWheel
[ "@wheel" ];
services.openssh = {
enable = true;
passwordAuthentication = false;
permitRootLogin = "no";
};
};
}