Add minimal configuration
This commit is contained in:
30
modules/datasync.nix
Normal file
30
modules/datasync.nix
Normal file
@@ -0,0 +1,30 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
services.samba = {
|
||||
enable = true;
|
||||
securityType = "share";
|
||||
nsswins = true;
|
||||
extraConfig = ''
|
||||
workgroup = WORKGROUP
|
||||
server string = samba
|
||||
netbios name = samba
|
||||
security = ${config.services.samba.securityType}
|
||||
hosts allow = 192.168.1 localhost
|
||||
hosts deny = 0.0.0.0/0
|
||||
guest account = nobody
|
||||
map to guest = bad user
|
||||
'';
|
||||
shares.public = {
|
||||
# FIXME Change path accordingly
|
||||
sharepath = "/mnt/Shares/Public";
|
||||
browseable = "yes";
|
||||
"read only" = "no";
|
||||
"guest ok" = "yes";
|
||||
"create mask" = "0644";
|
||||
"directory mask" = "0755";
|
||||
"force user" = "nobody";
|
||||
"force group" = "nobody";
|
||||
};
|
||||
};
|
||||
}
|
||||
26
modules/networking.nix
Normal file
26
modules/networking.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Enable zeroconf
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
nssmdns = true;
|
||||
publish = {
|
||||
enable = true;
|
||||
userServices = true;
|
||||
domain = true;
|
||||
workstation = true;
|
||||
};
|
||||
reflector = true;
|
||||
};
|
||||
|
||||
# Firewall configuration
|
||||
networking.firewall = {
|
||||
# Samba
|
||||
allowedTCPPorts = [ 445 139 ];
|
||||
allowedUDPPorts = [ 137 138 ];
|
||||
};
|
||||
|
||||
# Disable IPv6
|
||||
networking.enableIPv6 = false;
|
||||
}
|
||||
Reference in New Issue
Block a user