summary refs log tree commit diff
path: root/pkgs/servers
diff options
context:
space:
mode:
authorMarc Weber <marco-oweber@gmx.de>2009-04-26 11:06:41 +0000
committerMarc Weber <marco-oweber@gmx.de>2009-04-26 11:06:41 +0000
commit8d6fd9cb2bbf1443c7d4ad7a6c81dcfcadb39193 (patch)
treef255dd8ae5644a2b292c0d460d6f37946528e0f4 /pkgs/servers
parentf7454eae9cc9255883dd5afb6beb945fb49737f2 (diff)
downloadnixlib-8d6fd9cb2bbf1443c7d4ad7a6c81dcfcadb39193.tar
nixlib-8d6fd9cb2bbf1443c7d4ad7a6c81dcfcadb39193.tar.gz
nixlib-8d6fd9cb2bbf1443c7d4ad7a6c81dcfcadb39193.tar.bz2
nixlib-8d6fd9cb2bbf1443c7d4ad7a6c81dcfcadb39193.tar.lz
nixlib-8d6fd9cb2bbf1443c7d4ad7a6c81dcfcadb39193.tar.xz
nixlib-8d6fd9cb2bbf1443c7d4ad7a6c81dcfcadb39193.tar.zst
nixlib-8d6fd9cb2bbf1443c7d4ad7a6c81dcfcadb39193.zip
samba: Use /etc/samba as default configuration directory
svn path=/nixpkgs/trunk/; revision=15315
Diffstat (limited to 'pkgs/servers')
-rw-r--r--pkgs/servers/samba/default.nix24
1 files changed, 19 insertions, 5 deletions
diff --git a/pkgs/servers/samba/default.nix b/pkgs/servers/samba/default.nix
index 0464943f8369..64b7c5fc7de4 100644
--- a/pkgs/servers/samba/default.nix
+++ b/pkgs/servers/samba/default.nix
@@ -1,5 +1,15 @@
 { stdenv, fetchurl, readline, pam, openldap, kerberos, popt
 , iniparser, libunwind, fam, acl
+
+# Eg. smbclient and smbspool require a smb.conf file.
+# If you set configDir to "" an empty configuration file
+# $out/lib/smb.conf is is created for you.
+#
+# configDir defaults to "/etc/samba" so that smbpassword picks up
+# the location of its passwd db files from the system configuration file
+# /etc/samba/smb.conf. That's why nixos touches /etc/samba/smb.conf even if you
+# don't enable the samba upstart service.
+, configDir ? "/etc/samba"
 }:
 
 stdenv.mkDerivation rec {
@@ -14,11 +24,14 @@ stdenv.mkDerivation rec {
 
   preConfigure = "cd source";
 
-  # Provide a dummy smb.conf to shut up programs like smbclient and smbspool.
-  postInstall = ''
-    touch $out/lib/smb.conf
-  '';
-  
+  postInstall = if configDir == ""
+    then "touch $out/lib/smb.conf"
+    else "";
+
+
+  # Don't pass --with-private-dir=/var/samba/private
+  #            --with-lockdir=/var/samba/lock
+  # the build system will try to create it.
   configureFlags = ''
     --with-pam
     --with-cifsmount
@@ -26,6 +39,7 @@ stdenv.mkDerivation rec {
     --with-pam_smbpass
     --disable-swat
     --enable-shared-libs
+    --with-configdir=${configDir}
     ${if stdenv.gcc.libc != null then "--with-libiconv=${stdenv.gcc.libc}" else ""}
   '';
 }