diff options
| author | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-07-10 02:05:18 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-07-10 02:05:18 +0530 |
| commit | bf7a0f704a7ffc64d77f53d940f49f0bd9d4d35e (patch) | |
| tree | 596912421d29f6e58a9a45108df52cb4e1e68876 /modules | |
| parent | ee32d0d0813f9870d89fb7d821633fd8b4a9987a (diff) | |
| download | home-manager-config-bf7a0f704a7ffc64d77f53d940f49f0bd9d4d35e.tar.gz home-manager-config-bf7a0f704a7ffc64d77f53d940f49f0bd9d4d35e.zip | |
feat: using neomutt instead of meli for the tui email client
using a private module that stores the private config options for the user which are not to be pushed to the public repo
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/private/default.example.nix | 11 | ||||
| -rw-r--r-- | modules/private/email.example.nix | 18 | ||||
| -rw-r--r-- | modules/private/git.example.nix | 12 | ||||
| -rw-r--r-- | modules/programs/default.nix | 2 | ||||
| -rw-r--r-- | modules/programs/email/default.nix | 39 | ||||
| -rw-r--r-- | modules/programs/git/default.nix | 27 | ||||
| -rw-r--r-- | modules/programs/meli/default.nix | 46 | ||||
| -rw-r--r-- | modules/programs/neomutt/assertions.nix (renamed from modules/programs/meli/assertions.nix) | 0 | ||||
| -rw-r--r-- | modules/programs/neomutt/default.nix | 17 | ||||
| -rw-r--r-- | modules/scripts/default.nix | 13 |
10 files changed, 37 insertions, 148 deletions
diff --git a/modules/private/default.example.nix b/modules/private/default.example.nix deleted file mode 100644 index e5b1a84..0000000 --- a/modules/private/default.example.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ config, ... }: - -{ - # This file is a template for modules/private/default.nix - # Copy to modules/private/default.nix and fill in your secrets. - - imports = [ - ./git.nix - ./email.nix - ]; -} diff --git a/modules/private/email.example.nix b/modules/private/email.example.nix index ae3b475..0e35e26 100644 --- a/modules/private/email.example.nix +++ b/modules/private/email.example.nix @@ -1,16 +1,14 @@ { config, ... }: -let - mailDir = "${config.home.homeDirectory}/.local/mail"; -in { - accounts.email.accounts = { + config.accounts.email.accounts = { "example" = { realName = "Example User"; address = "user@example.com"; userName = "user@example.com"; passwordCommand = "${config.programs.gopass.package}/bin/gopass show -o mail/example"; flavor = "gmail.com"; + primary = true; mbsync = { enable = true; @@ -28,16 +26,4 @@ in imapnotify.enable = false; }; }; - - # Mbsync config - programs.mbsync = { - enable = true; - directory = mailDir; - }; - - # Notmuch config - programs.notmuch = { - enable = true; - database.path = "${mailDir}/.notmuch"; - }; } diff --git a/modules/private/git.example.nix b/modules/private/git.example.nix index 888c769..70e59b4 100644 --- a/modules/private/git.example.nix +++ b/modules/private/git.example.nix @@ -1,8 +1,12 @@ -{ config, ... }: +{ ... }: { - programs.git.signing = { - key = "EXAMPLE_GPG_KEY_ID"; - signByDefault = true; + config.programs.git = { + username = "Arpit Chakladar"; + email = "arpitchakladar+git@gmail.com"; + signing = { + key = "EXAMPLE_GPG_KEY_ID"; + signByDefault = true; + }; }; } diff --git a/modules/programs/default.nix b/modules/programs/default.nix index 1527087..cba7617 100644 --- a/modules/programs/default.nix +++ b/modules/programs/default.nix @@ -24,7 +24,7 @@ ./lf ./lsd ./maim - ./meli + ./neomutt ./nixvim ./nvtop ./opencode diff --git a/modules/programs/email/default.nix b/modules/programs/email/default.nix index 36dfc95..3a57cf0 100644 --- a/modules/programs/email/default.nix +++ b/modules/programs/email/default.nix @@ -2,12 +2,11 @@ { config, lib, - pkgs, ... }: let - mailDir = "${config.home.homeDirectory}/.local/mail"; + mailDir = "${config.home.homeDirectory}/.local/share/mail"; in { options.programs.email = { @@ -15,39 +14,11 @@ in }; config = lib.mkIf config.programs.email.enable { - home.packages = [ - pkgs.mbsync - pkgs.notmuch - ]; + programs.mbsync.enable = true; + programs.notmuch.enable = true; - home.sessionVariables = { - MAILDIR = mailDir; - NOTMUCH_CONFIG = "${config.xdg.configHome}/notmuch/notmuchrc"; - }; + accounts.email.maildirBasePath = mailDir; - xdg.configFile."notmuch/notmuch.config" = { - text = '' - [database] - path=${mailDir}/.notmuch - - [user] - name= - address= - primary_key= - - [new] - tags=unclassified;new; - ignore= - - [search] - exclude_tags=deleted;spam; - - [maildir] - synchronize_flags=true - - [crypto] - gpg_path=${pkgs.gnupg}/bin/gpg - ''; - }; + home.sessionVariables.MAILDIR = mailDir; }; } diff --git a/modules/programs/git/default.nix b/modules/programs/git/default.nix index 91498b0..cb4519d 100644 --- a/modules/programs/git/default.nix +++ b/modules/programs/git/default.nix @@ -6,7 +6,10 @@ # Git - Distributed version control system { - imports = [ ./assertions.nix ]; + imports = [ + ./assertions.nix + ] + ++ lib.optional (builtins.pathExists ../../private/git.nix) ../../private/git.nix; options.programs.git = { username = lib.mkOption { @@ -20,25 +23,10 @@ }; useSSH = lib.mkEnableOption "Use SSH instead of HTTPS for common git platforms."; - - signing = { - key = lib.mkOption { - type = lib.types.nullOr lib.types.str; - default = null; - description = "GPG signing key ID."; - }; - signByDefault = lib.mkEnableOption "Sign commits by default"; - }; }; config = lib.mkIf config.programs.git.enable { programs.git = { - includes = [ - { - path = "${config.xdg.configHome}/git/personal"; - condition = "hasconfig:remote.*.url:git@*"; - } - ]; settings = lib.recursiveUpdate { @@ -57,13 +45,6 @@ url."git@git.sr.ht:".insteadOf = "https://git.sr.ht/"; } ); - extraConfig = { - user.signingKey = lib.mkIf ( - config.programs.git.signing.key != null - ) config.programs.git.signing.key; - commit.gpgSign = config.programs.git.signing.signByDefault; - tag.forceSignAnnotated = config.programs.git.signing.signByDefault; - }; }; }; } diff --git a/modules/programs/meli/default.nix b/modules/programs/meli/default.nix deleted file mode 100644 index d17a3db..0000000 --- a/modules/programs/meli/default.nix +++ /dev/null @@ -1,46 +0,0 @@ -# meli - Terminal email client -{ - config, - lib, - pkgs, - ... -}: - -let - mailDir = "${config.home.homeDirectory}/.local/mail"; -in -{ - imports = [ ./assertions.nix ]; - - config = lib.mkIf config.programs.meli.enable { - home.packages = [ pkgs.meli ]; - - xdg.configFile."meli/config.toml" = { - text = '' - [terminal] - themes = "dark" - - [notifications] - enable = false - - [pager] - html_filter = "${pkgs.bat}/bin/bat --language=html" - - [composing] - editor_command = "${pkgs.neovim}/bin/nvim" - - [pgp] - auto_verify_signatures = true - gpg_binary = "${pkgs.gnupg}/bin/gpg" - - [search] - backend = "notmuch" - database_path = "${mailDir}/.notmuch" - ''; - }; - - programs.zsh.initExtra = lib.mkAfter '' - alias meli='meli-sync && meli' - ''; - }; -} diff --git a/modules/programs/meli/assertions.nix b/modules/programs/neomutt/assertions.nix index d651047..d651047 100644 --- a/modules/programs/meli/assertions.nix +++ b/modules/programs/neomutt/assertions.nix diff --git a/modules/programs/neomutt/default.nix b/modules/programs/neomutt/default.nix new file mode 100644 index 0000000..c0e16d4 --- /dev/null +++ b/modules/programs/neomutt/default.nix @@ -0,0 +1,17 @@ +# neomutt - Terminal email client +{ + config, + lib, + ... +}: + +{ + imports = [ ./assertions.nix ]; + + config = lib.mkIf config.programs.neomutt.enable { + programs.neomutt = { + sidebar.enable = true; + sort = "reverse-threads"; + }; + }; +} diff --git a/modules/scripts/default.nix b/modules/scripts/default.nix index 5e6b88b..9d29192 100644 --- a/modules/scripts/default.nix +++ b/modules/scripts/default.nix @@ -190,19 +190,6 @@ let } ]; }; - meli-sync = { - path = ./meli-sync.sh; - deps = [ - pkgs.mbsync - pkgs.notmuch - ]; - conditions = [ - { - option = "programs.meli.enable"; - value = true; - } - ]; - }; }; # Check whether all conditions for a script are satisfied |
