my nix configs for my servers and desktop

samba

Changed files
+56
hosts
valefar
+56
hosts/valefar/default.nix
···
"d /storage/immich 0755 immich immich -"
"d /storage/immich/photos 0755 immich immich -"
"Z /storage/immich 0755 immich immich -"
+
"d /storage/tm_share 0755 regent users"
];
# =============================================================================
···
'';
};
+
services.samba = {
+
enable = true;
+
settings = {
+
global = {
+
"workgroup" = "WORKGROUP";
+
"server string" = "valefar";
+
"netbios name" = "valefar";
+
"security" = "user";
+
+
"hosts allow" = "100.64.0.0/10 10.0.0.0/24 127.0.0.1 localhost";
+
"hosts deny" = "0.0.0.0/0";
+
"guest account" = "nobody";
+
"map to guest" = "bad user";
+
};
+
+
"tm_share" = {
+
"path" = tmPath;
+
"valid users" = regent;
+
"public" = "yes";
+
"writeable" = "yes";
+
"force user" = regent;
+
"fruit:aapl" = "yes";
+
"fruit:time machine" = "yes";
+
"vfs objects" = "catia fruit streams_xattr";
+
};
+
};
+
};
+
services.netatalk = {
enable = true;
settings = {
···
publish = {
enable = true;
userServices = true;
+
};
+
+
extraServiceFiles = {
+
timemachine = ''
+
<?xml version="1.0" standalone='no'?>
+
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
+
<service-group>
+
<name replace-wildcards="yes">%h</name>
+
<service>
+
<type>_smb._tcp</type>
+
<port>445</port>
+
</service>
+
<service>
+
<type>_device-info._tcp</type>
+
<port>0</port>
+
<txt-record>model=TimeCapsule8,119</txt-record>
+
</service>
+
<service>
+
<type>_adisk._tcp</type>
+
<!--
+
change tm_share to share name, if you changed it.
+
-->
+
<txt-record>dk0=adVN=tm_share,adVF=0x82</txt-record>
+
<txt-record>sys=waMa=0,adVF=0x100</txt-record>
+
</service>
+
</service-group>
+
'';
};
};