liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

default.nix (1558B)


      1 ## Secure Shell
      2 ## ============
      3 ##
      4 ## Provide SSH service using Dropbear
      5 
      6 { lib, pkgs, config, ...}:
      7 let
      8   inherit (lib) mkOption types;
      9   inherit (pkgs) liminix;
     10   mkBoolOption = description : mkOption {
     11     type = types.bool;
     12     inherit description;
     13     default = true;
     14   };
     15 
     16 in {
     17   options = {
     18     system.service.ssh = mkOption {
     19       type = liminix.lib.types.serviceDefn;
     20     };
     21   };
     22   config.system.service = {
     23     ssh = liminix.callService ./ssh.nix {
     24       address = mkOption {
     25         type = types.nullOr types.str;
     26         default = null;
     27         description = "Listen on specified address";
     28         example = "127.0.0.1";
     29       };
     30       port = mkOption {
     31         type = types.port;
     32         default = 22;
     33         description = "Listen on specified TCP port";
     34       };
     35       allowRoot = mkBoolOption "Allow root to login";
     36       allowPasswordLogin = mkBoolOption "Allow login using password (disable for public key auth only)";
     37       allowPasswordLoginForRoot = mkBoolOption "Allow root to login using password (disable for public key auth only)";
     38       allowLocalPortForward = mkBoolOption "Enable local port forwarding";
     39       allowRemotePortForward = mkBoolOption "Enable remote port forwarding";
     40       allowRemoteConnectionToForwardedPorts = mkOption {
     41         type = types.bool; default = false;
     42         description = "Allow remote hosts to connect to local forwarded ports (by default they are bound to loopback)";
     43       };
     44       extraConfig = mkOption {
     45         type = types.separatedString " ";
     46         default = "";
     47       };
     48     };
     49   };
     50 }