Add minimal configuration

This commit is contained in:
2021-02-08 13:42:35 +01:00
parent 32a18b5baa
commit 1d3d84f871
4 changed files with 144 additions and 9 deletions

30
modules/datasync.nix Normal file
View 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
View 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;
}