aboutsummaryrefslogtreecommitdiff
path: root/modules/hosts/openssh/default.nix
blob: 49c052746e8cc2e3d0811313b044b49a45082aa0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
  config,
  username,
  lib,
  ...
}:
let
  inherit (lib) mkOption types mkIf;
  cfg = config.nx.services.openssh;
in
{
  options.nx.services.openssh.enable = mkOption {
    description = "Setup openssh server";
    type = types.bool;
    default = false;
  };
  config = mkIf cfg.enable {
    services.openssh = {
      enable = true;
      settings = {
        AllowUsers = [ username ];
      };
    };
  };
}