From 72b6cc0d4bc84518f4357748ba41e3f1fd8bf592 Mon Sep 17 00:00:00 2001 From: Dustin Swan Date: Tue, 13 Jan 2026 17:51:50 -0700 Subject: [PATCH] mail, contacts, pass, linux and mac mbsync and vdirsyncer services, adding Passwords for these services to pass and syncthing, upping gpg agent timeout to infinity.. --- home-cli.nix | 7 +++++++ home-gui.nix | 36 ++++++++++++++++++------------------ home-linux.nix | 22 ++++++++++++++++++---- home-mac.nix | 24 ++++++++++++++++++++++-- home-mail.nix | 25 +++++++++++++++++++++++-- 5 files changed, 88 insertions(+), 26 deletions(-) diff --git a/home-cli.nix b/home-cli.nix index 27d0ec7..5bffc77 100644 --- a/home-cli.nix +++ b/home-cli.nix @@ -245,6 +245,13 @@ in programs.gpg.enable = true; + programs.password-store = { + enable = true; + settings = { + PASSWORD_STORE_DIR = "$HOME/.password-store"; + }; + }; + programs.keychain = { enable = true; keys = [ "id_rsa" "id_rsa_mr" "2B3A6377" ]; diff --git a/home-gui.nix b/home-gui.nix index 9d4125a..886f192 100644 --- a/home-gui.nix +++ b/home-gui.nix @@ -42,22 +42,22 @@ }; }; - programs.zed-editor = { - enable = true; - userSettings = { - vim_mode = true; - theme = { - mode = "system"; - light = "Catppuccin Latte"; - dark = "Catppuccin Frappé"; - }; - buffer_font_size = 16; - buffer_font_family = "Iosevka Nerd Font Mono"; - vim = { - enable_vim_sneak = true; - use_smartcase_find = true; - }; - format_on_save = "off"; - }; - }; + # programs.zed-editor = { + # enable = true; + # userSettings = { + # vim_mode = true; + # theme = { + # mode = "system"; + # light = "Catppuccin Latte"; + # dark = "Catppuccin Frappé"; + # }; + # buffer_font_size = 16; + # buffer_font_family = "Iosevka Nerd Font Mono"; + # vim = { + # enable_vim_sneak = true; + # use_smartcase_find = true; + # }; + # format_on_save = "off"; + # }; + # }; } diff --git a/home-linux.nix b/home-linux.nix index fadc34a..ff8f1e4 100644 --- a/home-linux.nix +++ b/home-linux.nix @@ -81,6 +81,10 @@ in path = "~/Sync"; devices = [ "Laptop" "Phone" ]; }; + "Passwords" = { + path = "~/.password-store"; + devices = [ "Laptop" ]; # just Mac, not phone + }; }; }; }; @@ -88,13 +92,23 @@ in services.gpg-agent = { enable = true; enableSshSupport = true; - defaultCacheTtl = 86400; - maxCacheTtl = 86400; - defaultCacheTtlSsh = 86400; - maxCacheTtlSsh = 86400; + defaultCacheTtl = 34560000; + maxCacheTtl = 34560000; + defaultCacheTtlSsh = 34560000; + maxCacheTtlSsh = 34560000; pinentry.package = pkgs.pinentry-all; }; + services.mbsync = { + enable = true; + frequency = "*:0/5"; # every 5 minutes + }; + + services.vdirsyncer = { + enable = true; + frequency = "*:0/15"; # every 15 minutes + }; + # Niri config - imported from separate file # xdg.configFile."niri/config.kdl".source = ./niri-config.kdl; diff --git a/home-mac.nix b/home-mac.nix index 8ab6439..b28c8ba 100644 --- a/home-mac.nix +++ b/home-mac.nix @@ -15,11 +15,31 @@ target = ".gnupg/gpg-agent.conf"; text = '' pinentry-program ${pkgs.pinentry_mac}/Applications/pinentry-mac.app/Contents/MacOS/pinentry-mac - default-cache-ttl 86400 - max-cache-ttl 86400 + default-cache-ttl 34560000 + max-cache-ttl 34560000 ''; }; + launchd.agents.mbsync = { + enable = true; + config = { + ProgramArguments = [ "${pkgs.isync}/bin/mbsync" "-a" ]; + StartInterval = 300; # every 5 minutes + StandardOutPath = "/tmp/mbsync.log"; + StandardErrorPath = "/tmp/mbsync.err"; + }; + }; + + launchd.agents.vdirsyncer = { + enable = true; + config = { + ProgramArguments = [ "${pkgs.vdirsyncer}/bin/vdirsyncer" "sync" ]; + StartInterval = 900; # every 15 minutes + StandardOutPath = "/tmp/vdirsyncer.log"; + StandardErrorPath = "/tmp/vdirsyncer.err"; + }; + }; + # https://codeberg.org/adamcstephens/dotfiles/src/commit/e14f35f6e9a9cb9174016948c512c0db364e0dec/apps/fish/init.fish programs.fish.shellInit = '' fenv source "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" diff --git a/home-mail.nix b/home-mail.nix index 24ce671..df56c52 100644 --- a/home-mail.nix +++ b/home-mail.nix @@ -5,6 +5,7 @@ programs.msmtp.enable = true; programs.himalaya.enable = true; programs.vdirsyncer.enable = true; + programs.khard.enable = true; programs.aerc = { enable = true; extraConfig.general.unsafe-accounts-conf = true; @@ -32,7 +33,7 @@ signByDefault = true; key = "AD11750151C10881970BD943AB49BD6B2B3A6377"; }; - passwordCommand = "gpg -dq ${builtins.getEnv "HOME"}/.dustinswan@fastmail.com-password.gpg"; + passwordCommand = "pass show email/fastmail"; mbsync = { enable = true; create = "maildir"; @@ -69,13 +70,33 @@ }; primary = true; remote = { - passwordCommand = ["~/dotfiles/bin/decrypt-password" "dustinswan@fastmail.com"]; + passwordCommand = ["pass" "show" "email/fastmail"]; type = "caldav"; url = "https://caldav.fastmail.com/dav/"; userName = "dustinswan@fastmail.com"; }; vdirsyncer = { enable = true; + collections = ["from a" "from b"]; + }; + }; + }; + }; + + accounts.contact = { + basePath = "Contacts"; + accounts = { + FastMail = { + khard.enable = true; + remote = { + passwordCommand = ["pass" "show" "email/fastmail"]; + type = "carddav"; + url = "https://carddav.fastmail.com/dav/"; + userName = "dustinswan@fastmail.com"; + }; + vdirsyncer = { + enable = true; + collections = ["from a" "from b"]; }; }; };