1
1
Fork 0
nixos/options/custom/services/samba.nix
Myned 53c8575116
git: migrate to forgejo
Squashes 1,331 commits

Signed-off-by: Myned <dev@bjork.tech>
2024-09-12 19:41:21 -05:00

42 lines
984 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
'';
};
};
}