From 3ebe3df4d01c3074f8b08508f395b97f4f015a97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Sat, 6 Sep 2014 23:37:57 +0200 Subject: [PATCH] nixos/samba: add services.samba.configText option The .configText option is for providing verbatim content of smb.conf. I'm adding this because I cannot seem to find any other way to override (with mkForce) the generated smb.conf with the current samba module. All attempts ends with errors ("duplicate entry samba/smb.conf"). --- nixos/modules/services/network-filesystems/samba.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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";