about summary refs log tree commit diff
path: root/ops/nixos/nugget/default.nix
diff options
context:
space:
mode:
authorVincent Ambo <Vincent Ambo>2020-01-05T16·40+0000
committerVincent Ambo <Vincent Ambo>2020-01-05T16·59+0000
commitd66c7a894222ce789b46de455607cd2c45c0e1f4 (patch)
tree80cf40de3327c618ec269fe6ffbb9d124962d234 /ops/nixos/nugget/default.nix
parente5608cf07900a068ce345d1a4cbf1e0cfe171daf (diff)
feat(ops/nixos/nugget): Install msmtp & lieer timers r/333
Diffstat (limited to 'ops/nixos/nugget/default.nix')
-rw-r--r--ops/nixos/nugget/default.nix25
1 files changed, 24 insertions, 1 deletions
diff --git a/ops/nixos/nugget/default.nix b/ops/nixos/nugget/default.nix
index 0871cbca61e8..5b469e893f5b 100644
--- a/ops/nixos/nugget/default.nix
+++ b/ops/nixos/nugget/default.nix
@@ -8,6 +8,8 @@ config: let
   nixpkgs = import pkgs.third_party.nixpkgsSrc {
     config.allowUnfree = true;
   };
+
+  lieer = (pkgs.third_party.lieer {});
 in pkgs.lib.fix(self: {
   hardware = {
     pulseaudio.enable = true;
@@ -70,7 +72,7 @@ in pkgs.lib.fix(self: {
   environment.systemPackages =
     # programs from the depot
     (with pkgs; [
-      (third_party.lieer {})
+      lieer
       ops.kontemplate
       third_party.git
       tools.emacs
@@ -93,6 +95,7 @@ in pkgs.lib.fix(self: {
       imagemagick
       jq
       kubectl
+      msmtp
       notmuch
       openssh
       openssl
@@ -174,6 +177,26 @@ in pkgs.lib.fix(self: {
     # Do not restart the display manager automatically
     systemd.services.display-manager.restartIfChanged = lib.mkForce false;
 
+    # Configure email setup
+    systemd.user.services.lieer-tazjin = {
+      description = "Synchronise mail@tazj.in via lieer";
+      script = "${lieer}/bin/gmi sync";
+
+      serviceConfig = {
+        WorkingDirectory = "%h/mail/account.tazjin";
+        Type = "oneshot";
+      };
+    };
+
+    systemd.user.timers.lieer-tazjin = {
+      wantedBy = [ "timers.target" ];
+
+      timerConfig = {
+        OnActiveSec = "1";
+        OnUnitActiveSec = "180";
+      };
+    };
+
     # ... and other nonsense.
     system.stateVersion = "19.09";
 })