about summary refs log tree commit diff
path: root/nixos/modules/services
diff options
context:
space:
mode:
authorPeter J. Jones <pjones@devalot.com>2016-11-02 21:06:47 -0700
committerFranz Pletz <fpletz@fnordicwalking.de>2016-11-03 05:06:47 +0100
commitd19967bf48c5605cb984b0f15863f013043c8ad9 (patch)
treefc0f4981941e8ab4c04d22ab47e9e58a30fe6184 /nixos/modules/services
parent7fd38dc8b32d12236c7b82f401d21dbd9d62e9fd (diff)
downloadnixlib-d19967bf48c5605cb984b0f15863f013043c8ad9.tar
nixlib-d19967bf48c5605cb984b0f15863f013043c8ad9.tar.gz
nixlib-d19967bf48c5605cb984b0f15863f013043c8ad9.tar.bz2
nixlib-d19967bf48c5605cb984b0f15863f013043c8ad9.tar.lz
nixlib-d19967bf48c5605cb984b0f15863f013043c8ad9.tar.xz
nixlib-d19967bf48c5605cb984b0f15863f013043c8ad9.tar.zst
nixlib-d19967bf48c5605cb984b0f15863f013043c8ad9.zip
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`
Diffstat (limited to 'nixos/modules/services')
-rw-r--r--nixos/modules/services/networking/vsftpd.nix11
1 files changed, 11 insertions, 0 deletions
diff --git a/nixos/modules/services/networking/vsftpd.nix b/nixos/modules/services/networking/vsftpd.nix
index 7ec484941ede..deff645d9bfd 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));
 
   };