91 lines
2.2 KiB
Nix
91 lines
2.2 KiB
Nix
{
|
|
username,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
{
|
|
boot = {
|
|
supportedFilesystems = [ "zfs" ];
|
|
zfs.extraPools = [ "yottapool" ];
|
|
};
|
|
|
|
services.zfs = {
|
|
autoScrub.enable = true;
|
|
zed.settings = {
|
|
ZED_DEBUG_LOG = "/tmp/zed.debug.log";
|
|
ZED_EMAIL_ADDR = [ username ];
|
|
ZED_EMAIL_PROG = lib.getExe pkgs.msmtp;
|
|
ZED_EMAIL_OPTS = "@ADDRESS@";
|
|
|
|
ZED_NOTIFY_INTERVAL_SECS = 3600;
|
|
ZED_NOTIFY_VERBOSE = true;
|
|
|
|
ZED_USE_ENCLOSURE_LEDS = true;
|
|
ZED_SCRUB_AFTER_RESILVER = true;
|
|
};
|
|
};
|
|
|
|
services.samba-wsdd = {
|
|
enable = true;
|
|
openFirewall = true;
|
|
};
|
|
|
|
# TODO: Clean up. Potentially make it a separate module
|
|
services.avahi = {
|
|
publish.enable = true;
|
|
publish.userServices = true;
|
|
nssmdns4 = true;
|
|
enable = true;
|
|
openFirewall = 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>
|
|
<txt-record>dk0=adVN=tm_share,adVF=0x82</txt-record>
|
|
<txt-record>sys=waMa=0,adVF=0x100</txt-record>
|
|
</service>
|
|
</service-group>
|
|
'';
|
|
};
|
|
};
|
|
|
|
services.samba = {
|
|
enable = true;
|
|
openFirewall = true;
|
|
settings = {
|
|
global = {
|
|
"workgroup" = "WORKGROUP";
|
|
"hosts allow" = "0.0.0.0/0";
|
|
"guest account" = "nobody";
|
|
"map to guest" = "bad user";
|
|
"getwd cache" = "true";
|
|
"strict sync" = "no";
|
|
"use sendfile" = "true";
|
|
};
|
|
"tm_share" = {
|
|
"path" = "/media/data/tm_share";
|
|
"valid users" = "niko";
|
|
"public" = "no";
|
|
"writeable" = "yes";
|
|
"force user" = "niko";
|
|
"fruit:aapl" = "yes";
|
|
"fruit:time machine" = "yes";
|
|
"vfs objects" = "catia fruit streams_xattr";
|
|
};
|
|
};
|
|
};
|
|
}
|