From ba0ab39cc7fa1421e37b4e213c59e61bcf5fa554 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Tue, 29 Nov 2016 16:09:20 +0100 Subject: machines/katara: offlineimap -> mbsync --- machines/profpatsch/katara.nix | 59 +++++++++++++++++++++++++++++++++++------- machines/profpatsch/pkgs.nix | 4 +-- 2 files changed, 50 insertions(+), 13 deletions(-) (limited to 'machines/profpatsch') diff --git a/machines/profpatsch/katara.nix b/machines/profpatsch/katara.nix index eb83d5e2..01c8cba0 100644 --- a/machines/profpatsch/katara.nix +++ b/machines/profpatsch/katara.nix @@ -151,7 +151,6 @@ in { ]; mailPkgs = [ elinks # command line browser - # myPkgs.offlineimap # IMAP client mutt-with-sidebar # has been sucking less since 1970 msmtp # SMTP client notmuch # mail indexer @@ -203,12 +202,6 @@ in { # drivers = [ pkgs.foomatic_filters pkgs.foomatic-db-engine ]; }; - services.offlineimap = { - # enable user service - install = true; - onCalendar = "*:0/15"; - }; - # redshift TODO as user services.redshift = { # enable = true; @@ -314,7 +307,6 @@ in { }; }; - # TODO: base config? vuizvui.programs.fish.fasd.enable = true; @@ -336,7 +328,54 @@ in { ################ # User services - # systemd.user = { - # }; + systemd.user = lib.mkMerge [ + + (lib.mkIf config.vuizvui.programs.gnupg.enable { + services.unlock-password-store = { + description = "unlock the user password store"; + wantedBy = [ "default.target" ]; + # make sure gpg-agent is running + wants = [ "gpg-agent.service" ]; + after = [ "gpg-agent.service" ]; + serviceConfig = { + # use special unlock key in the password store (needs to exist of course) + ExecStart = "${lib.getBin pkgs.pass}/bin/pass misc/unlock"; + StandardOutput = "null"; + }; + }; + timers.unlock-password-store = { + description = "unlock password store on system start"; + wantedBy = [ "timers.target" ]; + timerConfig.OnStartupSec = "5s"; + }; + }) + + { + services.mbsync = { + description = "mbsync job"; + wants = [ "notmuch.service" ]; + before = [ "notmuch.service"]; + path = [ pkgs.pass ]; + serviceConfig = { + Restart = "no"; + ExecStart = "${pkgs.isync}/bin/mbsync -a"; + }; + }; + timers.mbsync = { + description = "run mbsync job every 15 minutes"; + wantedBy = [ "timers.target" ]; + timerConfig.OnActiveSec="15m"; + }; + services.notmuch = { + description = "notmuch job"; + serviceConfig = { + Restart = "no"; + ExecStart = "${pkgs.notmuch}/bin/notmuch new"; + }; + }; + } + + ]; + }; } diff --git a/machines/profpatsch/pkgs.nix b/machines/profpatsch/pkgs.nix index 3e96479b..2524a4df 100644 --- a/machines/profpatsch/pkgs.nix +++ b/machines/profpatsch/pkgs.nix @@ -23,8 +23,6 @@ let # pkgs - offlineimap = addPythonRuntimeDeps pkgs.offlineimap [ pkgs.pythonPackages.pygpgme ]; - taffybar = pkgs.taffybar.override { ghcWithPackages = (pkgs.haskellPackages.override { overrides = _: super: { @@ -67,4 +65,4 @@ let xmpp-client = pkgs.callPackage (import ./xmpp-client.nix myLib.philip.home "irc/xmppOla.wtf") { inherit (pkgs) xmpp-client; }; in -{ inherit taffybar offlineimap sent mpv beets poezio vim fast-init xmpp-client; } +{ inherit taffybar sent mpv beets poezio vim fast-init xmpp-client; } -- cgit 1.4.1