Initial commit

This commit is contained in:
Toast 2023-06-01 13:07:12 +02:00
commit ea1a31f442
37 changed files with 875 additions and 0 deletions

37
roles/server/samba.nix Executable file
View file

@ -0,0 +1,37 @@
{ config, lib, ... }:
{
services = {
samba = {
enable = true;
openFirewall = true;
extraConfig = ''
map to guest = bad user
guest account = transmission
'';
shares = {
"Transmission downloads" = {
path = "${config.services.transmission.settings.download-dir}";
"read only" = true;
public = true;
"guest only" = true;
browseable = true;
};
};
};
avahi.extraServiceFiles = {
Transmission-downloads-smb = ''
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">SMB shares on %h</name>
<service>
<type>_smb._tcp</type>
<port>139</port>
</service>
</service-group>
'';
};
};
}