diff --git a/nixos/modules/services/network-filesystems/samba.nix b/nixos/modules/services/network-filesystems/samba.nix index 410a429621b..fd1e83d9f3e 100644 --- a/nixos/modules/services/network-filesystems/samba.nix +++ b/nixos/modules/services/network-filesystems/samba.nix @@ -28,6 +28,7 @@ let ''; configFile = pkgs.writeText "smb.conf" + (if cfg.configText != null then cfg.configText else '' [ global ] log file = ${logDir}/log.%m @@ -35,7 +36,7 @@ let ${optionalString cfg.syncPasswordsByPam "pam password change = true"} ${cfg.extraConfig} - ''; + ''); # This may include nss_ldap, needed for samba if it has to use ldap. nssModulesPath = config.system.nssModules.path; @@ -133,6 +134,15 @@ in "; }; + configText = mkOption { + type = types.nullOr types.lines; + default = null; + description = " + Verbatim contents of smb.conf. If null (default), use the + autogenerated file from NixOS instead. + "; + }; + securityType = mkOption { description = "Samba security type"; default = "user";