mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-06 19:00:14 +00:00
initial refactoring
This commit is contained in:
31
platforms/nixos/modules/nmasur/presets/services/samba.nix
Normal file
31
platforms/nixos/modules/nmasur/presets/services/samba.nix
Normal file
@ -0,0 +1,31 @@
|
||||
# Samba is a Windows-compatible file-sharing service.
|
||||
|
||||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.nmasur.presets.services.samba;
|
||||
in
|
||||
{
|
||||
|
||||
options.nmasur.presets.services.samba.enable = lib.mkEnableOption "Samba network filesharing";
|
||||
|
||||
config = {
|
||||
|
||||
services.samba = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
settings.data = {
|
||||
path = "/data";
|
||||
browseable = "yes";
|
||||
"read only" = "no";
|
||||
"guest ok" = "no";
|
||||
comment = "NAS";
|
||||
};
|
||||
};
|
||||
|
||||
# Allows Windows clients to discover server
|
||||
services.samba-wsdd.enable = true;
|
||||
networking.firewall.allowedTCPPorts = [ 5357 ];
|
||||
networking.firewall.allowedUDPPorts = [ 3702 ];
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user