From d19967bf48c5605cb984b0f15863f013043c8ad9 Mon Sep 17 00:00:00 2001 From: "Peter J. Jones" Date: Wed, 2 Nov 2016 21:06:47 -0700 Subject: [PATCH] vsftpd service: add extraConfig option, set anon_root (#20069) This commit includes two changes: 1. A new `extraConfig` option to allow administrators to set any vsftpd configuration option that isn't directly supported by this derivation. 2. Correctly set the `anon_root` vsftpd option to `anonymousUserHome` --- nixos/modules/services/networking/vsftpd.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nixos/modules/services/networking/vsftpd.nix b/nixos/modules/services/networking/vsftpd.nix index 7ec484941ed..deff645d9bf 100644 --- a/nixos/modules/services/networking/vsftpd.nix +++ b/nixos/modules/services/networking/vsftpd.nix @@ -100,6 +100,10 @@ let seccomp_sandbox=NO ''} anon_umask=${cfg.anonymousUmask} + ${optionalString cfg.anonymousUser '' + anon_root=${cfg.anonymousUserHome} + ''} + ${cfg.extraConfig} ''; in @@ -163,6 +167,13 @@ in description = "Anonymous write umask."; }; + extraConfig = mkOption { + type = types.lines; + default = ""; + example = "ftpd_banner=Hello"; + description = "Extra configuration to add at the bottom of the generated configuration file."; + }; + } // (listToAttrs (catAttrs "nixosOption" optionDescription)); };