diff options
author | Bjørn Forsman <bjorn.forsman@gmail.com> | 2014-09-06 00:45:47 +0200 |
---|---|---|
committer | Bjørn Forsman <bjorn.forsman@gmail.com> | 2014-09-24 18:31:20 +0200 |
commit | 753d9d4e4fb3d773c93ba005007c6578edd4bf7e (patch) | |
tree | 2323760af1dbf5270249418cc2eb7cba1118fffb /nixos/modules/services/network-filesystems/samba.nix | |
parent | 614a99bd8e20223ed3270d3cbc293cc03c878867 (diff) | |
download | nixlib-753d9d4e4fb3d773c93ba005007c6578edd4bf7e.tar nixlib-753d9d4e4fb3d773c93ba005007c6578edd4bf7e.tar.gz nixlib-753d9d4e4fb3d773c93ba005007c6578edd4bf7e.tar.bz2 nixlib-753d9d4e4fb3d773c93ba005007c6578edd4bf7e.tar.lz nixlib-753d9d4e4fb3d773c93ba005007c6578edd4bf7e.tar.xz nixlib-753d9d4e4fb3d773c93ba005007c6578edd4bf7e.tar.zst nixlib-753d9d4e4fb3d773c93ba005007c6578edd4bf7e.zip |
nixos/samba: remove services.samba.defaultShare option
It's not that difficult to define shares using standard samba config file syntax, so why do we need the semi-configurable .defaultShare option? Also: * It uses /home/smbd and I think /home should be reserved for real human users. * If enabled, it breaks the assumption that .extraConfig continues in the [global] section. Without .defaultShare there is no need for the "smbguest" user and group either, mark them as unused.
Diffstat (limited to 'nixos/modules/services/network-filesystems/samba.nix')
-rw-r--r-- | nixos/modules/services/network-filesystems/samba.nix | 41 |
1 files changed, 1 insertions, 40 deletions
diff --git a/nixos/modules/services/network-filesystems/samba.nix b/nixos/modules/services/network-filesystems/samba.nix index 4218b965cd9e..410a429621bb 100644 --- a/nixos/modules/services/network-filesystems/samba.nix +++ b/nixos/modules/services/network-filesystems/samba.nix @@ -6,9 +6,6 @@ let cfg = config.services.samba; - user = "smbguest"; - group = "smbguest"; - logDir = "/var/log/samba"; privateDir = "/var/samba/private"; @@ -16,12 +13,6 @@ let setupScript = '' - if ! test -d /home/smbd ; then - mkdir -p /home/smbd - chown ${user} /home/smbd - chmod a+rwx /home/smbd - fi - if ! test -d /var/samba ; then mkdir -p /var/samba/locks /var/samba/cores/nmbd /var/samba/cores/smbd /var/samba/cores/winbindd fi @@ -43,13 +34,6 @@ 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} ''; @@ -149,21 +133,6 @@ in "; }; - 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; - }; - }; - securityType = mkOption { description = "Samba security type"; default = "user"; @@ -199,14 +168,6 @@ in (mkIf config.services.samba.enable { - users.extraUsers.smbguest = { - description = "Samba service user"; - group = group; - uid = config.ids.uids.smbguest; - }; - - users.extraGroups.smbguest.gid = config.ids.uids.smbguest; - system.nssModules = optional cfg.nsswins samba; systemd = { @@ -224,7 +185,7 @@ in "samba-setup" = { description = "Samba Setup Task"; script = setupScript; - unitConfig.RequiresMountsFor = "/home/smbd /var/samba /var/log/samba"; + unitConfig.RequiresMountsFor = "/var/samba /var/log/samba"; }; }; }; |