1
1
Fork 0
nixos/options/custom/services/samba.nix
Myned ab485dec35
nix: format with alejandra
Signed-off-by: Myned <dev@bjork.tech>
2024-09-12 20:50:53 -05:00

42 lines
986 B
Nix

{
config,
lib,
...
}:
with lib; let
cfg = config.custom.services.samba;
in {
options.custom.services.samba.enable = mkOption {default = false;};
config = mkIf cfg.enable {
# https://wiki.nixos.org/wiki/Samba
# https://gitlab.com/samba-team/samba
#!! User configuration is imperative
#?? sudo smbpasswd -a $USER
services.samba = {
enable = true;
openFirewall = true;
shares = {
Public.path = "/home/${config.custom.username}/Public";
SYNC.path = "/home/${config.custom.username}/SYNC";
};
extraConfig = ''
logging = systemd
hosts allow = 127.0.0.1 myndows 192.168.111.
browseable = yes
writeable = yes
force user = ${config.custom.username}
map to guest = bad password
inherit owner = unix only
inherit permissions = yes
follow symlinks = yes
wide links = yes
allow insecure wide links = yes
'';
};
};
}