git.iko.soy/typeable/nixpkgs
on master help sign in
services/tahoe: SFTP support (#20372)
commit45854a02e8e25704d54f7475566ebfdfd2fcdacc authorFranz Pletz <fpletz@fnordicwalking.de> dateTue 15 Nov 2016, 07:01 (10 years ago) parent520db3b2548fd6
1 file changed+52
nixos/modules/services/network-filesystems/tahoe.nix+52
nixos/modules/services/network-filesystems/tahoe.nix+52
@@ -138,6 +138,45 @@ in
138138 '';
139139 };
140140 helper.enable = mkEnableOption "helper service";
141+ sftpd.enable = mkEnableOption "SFTP service";
142+ sftpd.port = mkOption {
143+ default = null;
144+ type = types.nullOr types.int;
145+ description = ''
146+ The port on which the SFTP server will listen.
147+
148+ This is the correct setting to tweak if you want Tahoe's SFTP
149+ daemon to listen on a different port.
150+ '';
151+ };
152+ sftpd.hostPublicKeyFile = mkOption {
153+ default = null;
154+ type = types.nullOr types.path;
155+ description = ''
156+ Path to the SSH host public key.
157+ '';
158+ };
159+ sftpd.hostPrivateKeyFile = mkOption {
160+ default = null;
161+ type = types.nullOr types.path;
162+ description = ''
163+ Path to the SSH host private key.
164+ '';
165+ };
166+ sftpd.accounts.file = mkOption {
167+ default = null;
168+ type = types.nullOr types.path;
169+ description = ''
170+ Path to the accounts file.
171+ '';
172+ };
173+ sftpd.accounts.url = mkOption {
174+ default = null;
175+ type = types.nullOr types.str;
176+ description = ''
177+ URL of the accounts server.
178+ '';
179+ };
141180 package = mkOption {
142181 default = pkgs.tahoelafs;
143182 defaultText = "pkgs.tahoelafs";
@@ -256,6 +295,19 @@ in
256295
257296 [helper]
258297 enabled = ${if settings.helper.enable then "true" else "false"}
298+
299+ [sftpd]
300+ enabled = ${if settings.sftpd.enable then "true" else "false"}
301+ ${optionalString (settings.sftpd.port != null)
302+ "port = ${toString settings.sftpd.port}"}
303+ ${optionalString (settings.sftpd.hostPublicKeyFile != null)
304+ "host_pubkey_file = ${settings.sftpd.hostPublicKeyFile}"}
305+ ${optionalString (settings.sftpd.hostPrivateKeyFile != null)
306+ "host_privkey_file = ${settings.sftpd.hostPrivateKeyFile}"}
307+ ${optionalString (settings.sftpd.accounts.file != null)
308+ "accounts.file = ${settings.sftpd.accounts.file}"}
309+ ${optionalString (settings.sftpd.accounts.url != null)
310+ "accounts.url = ${settings.sftpd.accounts.url}"}
259311 '';
260312 });
261313 # Actually require Tahoe, so that we will have it installed.