summary refs log tree commit diff
path: root/modules/services/network-filesystems
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2010-03-16 16:34:27 +0000
committerMichael Raskin <7c6f434c@mail.ru>2010-03-16 16:34:27 +0000
commit11f8647d73742558a300aff247528251acad7833 (patch)
tree6e8a789e34f5948882b9267f64e6328e925d3153 /modules/services/network-filesystems
parentbd81b7a1738deb97d4c1ddd930d207056824592b (diff)
downloadnixpkgs-11f8647d73742558a300aff247528251acad7833.tar
nixpkgs-11f8647d73742558a300aff247528251acad7833.tar.gz
nixpkgs-11f8647d73742558a300aff247528251acad7833.tar.bz2
nixpkgs-11f8647d73742558a300aff247528251acad7833.tar.lz
nixpkgs-11f8647d73742558a300aff247528251acad7833.tar.xz
nixpkgs-11f8647d73742558a300aff247528251acad7833.tar.zst
nixpkgs-11f8647d73742558a300aff247528251acad7833.zip
Add a default share to Samba to make creating simple fileserver easier
svn path=/nixos/trunk/; revision=20665
Diffstat (limited to 'modules/services/network-filesystems')
-rw-r--r--modules/services/network-filesystems/samba.nix23
1 files changed, 23 insertions, 0 deletions
diff --git a/modules/services/network-filesystems/samba.nix b/modules/services/network-filesystems/samba.nix
index 814ca7e2316..be7406cd5df 100644
--- a/modules/services/network-filesystems/samba.nix
+++ b/modules/services/network-filesystems/samba.nix
@@ -49,6 +49,13 @@ let
       private dir = ${privateDir}
       ${optionalString cfg.syncPasswordsByPam "pam password change = true"}
 
+      ${if cfg.defaultShare.enable then ''
+      [default]
+      path = /home/smbd
+      read only = ${if cfg.defaultShare.writeable then "no" else "yes"}
+      guest ok = ${if cfg.defaultShare.guest then "yes" else "no"}
+      ''else ""}
+
       ${cfg.extraConfig}
     '';
 
@@ -136,6 +143,22 @@ in
           internal use to pass filepath to samba pam module
         ";
       };
+
+      defaultShare = {
+        enable = mkOption {
+	  description = "Whether to share /home/smbd as 'default'";
+	  default = false;
+	};
+        writeable = mkOption {
+	  description = "Whether to allow write access to default share";
+	  default = false;
+	};
+        guest = mkOption {
+	  description = "Whether to allow guest access to default share";
+	  default = true;
+	};
+      };
+
     };
 
   };