summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorCorbin <cds@corbinsimpson.com>2016-10-28 22:23:53 -0700
committerCorbin <cds@corbinsimpson.com>2016-11-13 17:13:18 -0800
commit2548fd6908d38cee7a80d99b0dd68e26935e8df5 (patch)
tree673f59d3d65203c8c83dcf68e732c6ae837995d5 /nixos/modules
parent7f71b89454ebfb0699ca441329f8cb36466d74ee (diff)
downloadnixpkgs-2548fd6908d38cee7a80d99b0dd68e26935e8df5.tar
nixpkgs-2548fd6908d38cee7a80d99b0dd68e26935e8df5.tar.gz
nixpkgs-2548fd6908d38cee7a80d99b0dd68e26935e8df5.tar.bz2
nixpkgs-2548fd6908d38cee7a80d99b0dd68e26935e8df5.tar.lz
nixpkgs-2548fd6908d38cee7a80d99b0dd68e26935e8df5.tar.xz
nixpkgs-2548fd6908d38cee7a80d99b0dd68e26935e8df5.tar.zst
nixpkgs-2548fd6908d38cee7a80d99b0dd68e26935e8df5.zip
services/tahoe: SFTP support.
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/services/network-filesystems/tahoe.nix52
1 files changed, 52 insertions, 0 deletions
diff --git a/nixos/modules/services/network-filesystems/tahoe.nix b/nixos/modules/services/network-filesystems/tahoe.nix
index f1846b96325..f91827c379d 100644
--- a/nixos/modules/services/network-filesystems/tahoe.nix
+++ b/nixos/modules/services/network-filesystems/tahoe.nix
@@ -138,6 +138,45 @@ in
               '';
             };
             helper.enable = mkEnableOption "helper service";
+            sftpd.enable = mkEnableOption "SFTP service";
+            sftpd.port = mkOption {
+              default = null;
+              type = types.nullOr types.int;
+              description = ''
+                The port on which the SFTP server will listen.
+
+                This is the correct setting to tweak if you want Tahoe's SFTP
+                daemon to listen on a different port.
+              '';
+            };
+            sftpd.hostPublicKeyFile = mkOption {
+              default = null;
+              type = types.nullOr types.path;
+              description = ''
+                Path to the SSH host public key.
+              '';
+            };
+            sftpd.hostPrivateKeyFile = mkOption {
+              default = null;
+              type = types.nullOr types.path;
+              description = ''
+                Path to the SSH host private key.
+              '';
+            };
+            sftpd.accounts.file = mkOption {
+              default = null;
+              type = types.nullOr types.path;
+              description = ''
+                Path to the accounts file.
+              '';
+            };
+            sftpd.accounts.url = mkOption {
+              default = null;
+              type = types.nullOr types.str;
+              description = ''
+                URL of the accounts server.
+              '';
+            };
             package = mkOption {
               default = pkgs.tahoelafs;
               defaultText = "pkgs.tahoelafs";
@@ -256,6 +295,19 @@ in
 
                 [helper]
                 enabled = ${if settings.helper.enable then "true" else "false"}
+
+                [sftpd]
+                enabled = ${if settings.sftpd.enable then "true" else "false"}
+                ${optionalString (settings.sftpd.port != null)
+                  "port = ${toString settings.sftpd.port}"}
+                ${optionalString (settings.sftpd.hostPublicKeyFile != null)
+                  "host_pubkey_file = ${settings.sftpd.hostPublicKeyFile}"}
+                ${optionalString (settings.sftpd.hostPrivateKeyFile != null)
+                  "host_privkey_file = ${settings.sftpd.hostPrivateKeyFile}"}
+                ${optionalString (settings.sftpd.accounts.file != null)
+                  "accounts.file = ${settings.sftpd.accounts.file}"}
+                ${optionalString (settings.sftpd.accounts.url != null)
+                  "accounts.url = ${settings.sftpd.accounts.url}"}
               '';
             });
           # Actually require Tahoe, so that we will have it installed.