blob: d1f186bc27a82414748f22bf6d1a2c6a2b44dbfe (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
{ config, pkgs, lib, ... }:
let
makePublicShare = path: {
name = builtins.baseNameOf path;
value = {
inherit path;
browseable = "yes";
writeable = "no";
"guest ok" = "yes";
"guest only" = "yes";
"force user" = "nobody";
};
};
publicShares = [ "/data/fast/music" "/data/fast/videos" ];
in
{
# https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/network-filesystems/samba.nix
services.samba = {
enable = true;
extraConfig = ''
workgroup = WORKGROUP
server string = tahoe
netbios name = tahoe
security = user
guest account = nobody
mangled names = no
client min protocol = SMB2
map to guest = bad user
ntlm auth = true
'';
shares = with lib; (listToAttrs (map makePublicShare cfg.publicShares));
};
}
|