unit/modules/datasync.nix

73 lines
1.6 KiB
Nix
Raw Normal View History

2021-02-08 13:42:35 +01:00
{ config, lib, pkgs, ... }:
{
2021-03-19 11:12:57 +01:00
# Samba configuration
environment.systemPackages = with pkgs; [ samba ];
2021-02-08 13:42:35 +01:00
services.samba = {
enable = true;
nsswins = true;
extraConfig = ''
workgroup = WORKGROUP
2021-03-19 11:12:57 +01:00
server string = unit
netbios name = unit
2021-02-08 13:42:35 +01:00
guest account = nobody
map to guest = bad user
2021-03-19 11:12:57 +01:00
load printers=no
smb encrypt = required
server min protocol = SMB2_10
client min protocol = SMB2
client max protocol = SMB3
ntlm auth = yes
2021-02-08 13:42:35 +01:00
'';
shares.public = {
2021-03-19 11:12:57 +01:00
path = "/vault/samba/CSD";
2021-02-08 13:42:35 +01:00
browseable = "yes";
"read only" = "no";
2021-03-30 09:51:46 +02:00
"guest ok" = "yes";
2021-02-08 13:42:35 +01:00
"create mask" = "0644";
"directory mask" = "0755";
2021-03-19 11:12:57 +01:00
"force user" = "coace";
2021-02-08 13:42:35 +01:00
};
};
# ZFS automatic backup solution
services.znapzend = {
enable = true;
pure = true;
zetup."vault" = {
plan = "1h=>10min,1d=>1h,1w=>1d,1m=>1w,1y=>1m";
recursive = true;
destinations.backup = {
host = "10.0.1.4";
dataset = "shield/unit";
plan = "1w=>1d,1m=>1w,1y=>1m";
};
};
};
2021-04-07 13:18:31 +02:00
# Nextcloud configuration
services.nextcloud = {
enable = true;
package = pkgs.nextcloud21;
home = "/vault/nextcloud";
hostName = "coace.duckdns.org";
2021-04-07 13:18:31 +02:00
https = true;
autoUpdateApps = {
enable = true;
startAt = "Sun 05:00:00";
};
config = {
overwriteProtocol = "https";
dbtype = "pgsql";
dbuser = "nextcloud";
dbname = "nextcloud";
dbpassFile = "/var/keys/nextcloud";
adminpassFile = "/var/keys/nextcloud-admin";
adminuser = "admin";
defaultPhoneRegion = "ES";
};
};
2021-02-08 13:42:35 +01:00
}