about summary refs log tree commit diff
path: root/modules/workstation/mail/notmuch/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/workstation/mail/notmuch/default.nix')
-rw-r--r--modules/workstation/mail/notmuch/default.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/workstation/mail/notmuch/default.nix b/modules/workstation/mail/notmuch/default.nix
new file mode 100644
index 000000000000..cb7ccd877950
--- /dev/null
+++ b/modules/workstation/mail/notmuch/default.nix
@@ -0,0 +1,21 @@
+{ pkgs, ... }:
+
+{
+  environment.extraInit = ''
+    export NOTMUCH_CONFIG="/etc/xdg/nixos/per-user/$USER/notmuch/config"
+  '';
+
+  environment.systemPackages = with pkgs; [ notmuch ];
+
+  users.users.qyliss.xdg.config.paths."notmuch/config" =
+    pkgs.copyPathToStore ./config;
+
+  systemd.services.notmuch = {
+    serviceConfig.Type = "oneshot";
+    environment.NOTMUCH_CONFIG = "/etc/xdg/nixos/per-user/qyliss/notmuch/config";
+    serviceConfig.ExecStart = "${pkgs.notmuch}/bin/notmuch new";
+    serviceConfig.IOSchedulingClass = "idle";
+    serviceConfig.Nice = 1;
+    serviceConfig.User = "qyliss";
+  };
+}