2022-07-31 11:03:59 +02:00
|
|
|
# SPDX-FileCopyrightText: 2022 Richard Brežák <richard@brezak.sk>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: LGPL-3.0-or-later
|
2021-07-31 13:24:30 +02:00
|
|
|
{
|
2022-07-31 11:03:59 +02:00
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
cfg = config.magic_rb.vpsRemoteAccess;
|
|
|
|
in {
|
2021-07-31 13:24:30 +02:00
|
|
|
options.magic_rb = {
|
|
|
|
vpsRemoteAccess = {
|
|
|
|
enable = mkEnableOption "Enable VPS remote access module.";
|
|
|
|
trustedWheel = mkEnableOption "Add the wheel group to Nix trusted-users.";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-07-31 11:03:59 +02:00
|
|
|
config =
|
|
|
|
mkIf cfg.enable
|
2021-07-31 13:24:30 +02:00
|
|
|
{
|
2022-07-31 11:03:59 +02:00
|
|
|
nix.settings.trusted-users =
|
|
|
|
mkIf cfg.trustedWheel
|
|
|
|
["@wheel"];
|
2021-07-31 13:24:30 +02:00
|
|
|
|
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
passwordAuthentication = false;
|
|
|
|
permitRootLogin = "no";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|