Add a default share to Samba to make creating simple fileserver easier
svn path=/nixos/trunk/; revision=20665
This commit is contained in:
parent
bd81b7a173
commit
11f8647d73
|
@ -49,6 +49,13 @@ let
|
||||||
private dir = ${privateDir}
|
private dir = ${privateDir}
|
||||||
${optionalString cfg.syncPasswordsByPam "pam password change = true"}
|
${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}
|
${cfg.extraConfig}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -136,6 +143,22 @@ in
|
||||||
internal use to pass filepath to samba pam module
|
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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue