mirror of
				https://github.com/nmasur/dotfiles
				synced 2025-11-04 12:53:15 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			32 lines
		
	
	
		
			708 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			708 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
# 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 ];
 | 
						|
  };
 | 
						|
}
 |