diff --git a/container/Ddns.nix b/container/Ddns.nix index 7d16040..7937926 100644 --- a/container/Ddns.nix +++ b/container/Ddns.nix @@ -32,7 +32,7 @@ in { services.cloudflare-dyndns = { enable = true; apiTokenFile = "/data/token"; - deleteMissing = true; + deleteMissing = false; ipv4 = true; ipv6 = false; proxied = false; @@ -46,10 +46,6 @@ in { "paste" "play" "vpn" - "fmp-git" - "fmp-cloud" - "fmp-dev" - "fmp-master" ]; }; }; diff --git a/container/Mail.nix b/container/Mail.nix index 9d6e44e..a9f2d7a 100644 --- a/container/Mail.nix +++ b/container/Mail.nix @@ -144,7 +144,7 @@ in { Junk = { auto = "subscribe"; specialUse = "Junk"; - autoexpunge = "7d"; + # autoexpunge = "3d"; }; Sent = { auto = "subscribe"; @@ -153,7 +153,7 @@ in { Trash = { auto = "subscribe"; specialUse = "Trash"; - autoexpunge = "30d"; + # autoexpunge = "30d"; }; }; @@ -170,31 +170,54 @@ in { # }; }; - services.roundcube = { - enable = true; - dicts = with pkgs.aspellDicts; [ en ru ]; - hostName = cfg.domain; - plugins = [ - "managesieve" - ]; - extraConfig = '' - # starttls needed for authentication, so the fqdn required to match - # the certificate - # $config['smtp_server'] = "tls://${config.mailserver.fqdn}"; - # $config['smtp_server'] = "tls://localhost"; - $config['smtp_server'] = "localhost:25"; - $config['smtp_auth_type'] = null; - $config['smtp_user'] = ""; - $config['smtp_pass'] = ""; - # $config['smtp_user'] = "%u"; - # $config['smtp_pass'] = "%p"; - ''; + services = { + roundcube = { + enable = true; + dicts = with pkgs.aspellDicts; [ en ru ]; + hostName = cfg.domain; + plugins = [ + "managesieve" + ]; + extraConfig = '' + # starttls needed for authentication, so the fqdn required to match + # the certificate + # $config['smtp_server'] = "tls://${config.mailserver.fqdn}"; + # $config['smtp_server'] = "tls://localhost"; + $config['smtp_server'] = "localhost:25"; + $config['smtp_auth_type'] = null; + $config['smtp_user'] = ""; + $config['smtp_pass'] = ""; + # $config['smtp_user'] = "%u"; + # $config['smtp_pass'] = "%p"; + ''; + }; + + nginx = { + virtualHosts.${cfg.domain} = { + forceSSL = false; + enableACME = false; + }; + }; }; - services.nginx = { - virtualHosts.${cfg.domain} = { - forceSSL = false; - enableACME = false; + systemd = { + services.autoexpunge = { + description = "Delete old mail"; + serviceConfig.Type = "oneshot"; + path = [ pkgs.dovecot ]; + script = '' + doveadm expunge -A mailbox Junk SENTBEFORE 7d + doveadm expunge -A mailbox Trash SENTBEFORE 30d + ''; + }; + + timers.autoexpunge = { + timerConfig = { + OnCalendar = "daily"; + Persistent = true; + Unit = "autoexpunge.service"; + }; + wantedBy = [ "timers.target" ]; }; }; }; diff --git a/module/Ollama.nix b/module/Ollama.nix index e323a84..bbcb36e 100644 --- a/module/Ollama.nix +++ b/module/Ollama.nix @@ -23,29 +23,31 @@ in { variables.OLLAMA_MODEL = cfg.primaryModel; }; - # Enable Ollama server. - systemd.services.ollama = { - description = "Ollama LLM server."; - wantedBy = [ "multi-user.target" ]; - wants = [ "NetworkManager-wait-online.service" ]; - after = [ "NetworkManager-wait-online.service" ]; - serviceConfig.Type = "simple"; - script = '' - HOME=/root ${getExe pkgs.ollama} serve - ''; - }; + systemd.services = { + # Enable Ollama server. + ollama = { + description = "Ollama LLM server."; + wantedBy = [ "multi-user.target" ]; + wants = [ "NetworkManager-wait-online.service" ]; + after = [ "NetworkManager-wait-online.service" ]; + serviceConfig.Type = "simple"; + script = '' + HOME=/root ${getExe pkgs.ollama} serve + ''; + }; - # Download Ollama models. - systemd.services.ollamamodel = { - description = "Ollama LLM model."; - wantedBy = [ "multi-user.target" ]; - wants = [ "ollama.service" ]; - after = [ "ollama.service" ]; - serviceConfig.Type = "simple"; - script = '' - sleep 5 - ${getExe pkgs.ollama} pull ${concatStringsSep " " cfg.models} - ''; + # Download Ollama models. + ollamamodel = { + description = "Ollama LLM model."; + wantedBy = [ "multi-user.target" ]; + wants = [ "ollama.service" ]; + after = [ "ollama.service" ]; + serviceConfig.Type = "simple"; + script = '' + sleep 5 + ${getExe pkgs.ollama} pull ${concatStringsSep " " cfg.models} + ''; + }; }; }; }