From 4ba922434872dd384efa8aaef1e8eb3b42959c86 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 15 Jul 2025 21:36:05 +0200 Subject: [PATCH 01/11] feat(accounts): add emails workflow settings --- flake.lock | 41 +++- flake.nix | 23 +- hosts/morty/home-config.nix | 10 +- hosts/morty/includes/home-manager.nix | 3 +- .../home-manager/accounts/email/default.nix | 222 ++++++++++++++++++ .../accounts/email/files/theme.muttrc | 117 +++++++++ modules/home-manager/default.nix | 1 + 7 files changed, 402 insertions(+), 15 deletions(-) create mode 100644 modules/home-manager/accounts/email/default.nix create mode 100644 modules/home-manager/accounts/email/files/theme.muttrc diff --git a/flake.lock b/flake.lock index da4e55b..3176169 100644 --- a/flake.lock +++ b/flake.lock @@ -56,6 +56,26 @@ "type": "github" } }, + "nix-private": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1754265461, + "narHash": "sha256-qVA40ypUxsQR+kpzgqrsS2JrdwS6CI7JQcvpLjc+nlg=", + "ref": "main", + "rev": "7ce0411fc0c480211951ef58b263c5eb72579681", + "shallow": true, + "type": "git", + "url": "ssh://git@git.epha.se:24422/ephase/nix-private.git" + }, + "original": { + "ref": "main", + "shallow": true, + "type": "git", + "url": "ssh://git@git.epha.se:24422/ephase/nix-private.git" + } + }, "nixgl": { "inputs": { "flake-utils": "flake-utils", @@ -78,6 +98,20 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1753722563, + "narHash": "sha256-FK8iq76wlacriq3u0kFCehsRYTAqjA9nfprpiSWRWIc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "648f70160c03151bc2121d179291337ad6bc564b", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1748693115, "narHash": "sha256-StSrWhklmDuXT93yc3GrTlb0cKSS0agTAxMGjLKAsY8=", @@ -92,7 +126,7 @@ "type": "indirect" } }, - "nixpkgs_2": { + "nixpkgs_3": { "locked": { "lastModified": 1748693115, "narHash": "sha256-StSrWhklmDuXT93yc3GrTlb0cKSS0agTAxMGjLKAsY8=", @@ -111,7 +145,7 @@ "nur": { "inputs": { "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "treefmt-nix": "treefmt-nix" }, "locked": { @@ -131,8 +165,9 @@ "root": { "inputs": { "home-manager": "home-manager", + "nix-private": "nix-private", "nixgl": "nixgl", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "nur": "nur", "sops-nix": "sops-nix" } diff --git a/flake.nix b/flake.nix index 84149e0..251eabc 100644 --- a/flake.nix +++ b/flake.nix @@ -15,20 +15,23 @@ url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + nix-private = { + url = "git+ssh://git@git.epha.se:24422/ephase/nix-private.git?shallow=1&ref=main"; + }; }; outputs = { self, nixpkgs, home-manager, nur, nixgl, sops-nix, ... }@inputs: - let + let stateVersion = "23.11"; - + allSystems = [ "x86_64-linux" # 64bit AMD/Intel x86 "aarch64-linux" # 64bit ARM Linux ]; - + forAllSystems = fn: nixpkgs.lib.genAttrs allSystems (system: fn { pkgs = import nixpkgs { inherit system; }; }); - + createNixosSystem = { system, hostname, username ? "ephase" }: nixpkgs.lib.nixosSystem { system = system; specialArgs = { @@ -40,7 +43,7 @@ ./nixos/default.nix ]; }; - + createHomeConfiguration = { system ? "x86_64-linux", hostname, username ? "ephase" }: home-manager.lib.homeManagerConfiguration { pkgs = import nixpkgs { @@ -79,13 +82,13 @@ luci = createNixosSystem { system = "x86_64-linux"; hostname = "luci"; }; }; homeConfigurations = { - "rick" = createHomeConfiguration { system = "aarch64-linux"; hostname = "rick";}; - "luci" = createHomeConfiguration { system = "x86_64-linux"; hostname = "luci";}; - "morty" = createHomeConfiguration { system = "x86_64-linux"; hostname = "morty";}; - "mrmeeseeks" = createHomeConfiguration { system = "x86_64-linux"; hostname = "mrmeeseeks";}; + "rick" = createHomeConfiguration { system = "aarch64-linux"; hostname = "rick";}; + "luci" = createHomeConfiguration { system = "x86_64-linux"; hostname = "luci";}; + "morty" = createHomeConfiguration { system = "x86_64-linux"; hostname = "morty";}; + "mrmeeseeks" = createHomeConfiguration { system = "x86_64-linux"; hostname = "mrmeeseeks";}; "work" = createHomeConfiguration { system = "x86_64-linux"; - hostname = "work"; + hostname = "work"; username = "yorick-barbanneau"; }; }; diff --git a/hosts/morty/home-config.nix b/hosts/morty/home-config.nix index afb756a..17453be 100644 --- a/hosts/morty/home-config.nix +++ b/hosts/morty/home-config.nix @@ -1,5 +1,13 @@ -{ ... }: { +{ inputs, ... }: { config.modules = { + email = { + enable = true; + accountConfigs = { + ubordeaux = inputs.nix-private.mail.ubordeaux; + xiemeart = inputs.nix-private.mail.xiemeart; + }; + primary = "xiemeart"; + }; application = { gnupg = { enable = true; diff --git a/hosts/morty/includes/home-manager.nix b/hosts/morty/includes/home-manager.nix index cad60ba..9643c77 100644 --- a/hosts/morty/includes/home-manager.nix +++ b/hosts/morty/includes/home-manager.nix @@ -1,6 +1,6 @@ { ... }: { - home.file.".config/xkb/symbols/gpdwinmax".text = + home.file.".config/xkb/symbols/gpdwinmax".text = '' default partial alphanumeric_keys xkb_symbols "us-intl-winmax" { @@ -30,4 +30,5 @@ scale = "1.3"; }; }; + sops.age.keyFile = "/home/ephase/.config/sops/age/keys.txt"; } diff --git a/modules/home-manager/accounts/email/default.nix b/modules/home-manager/accounts/email/default.nix new file mode 100644 index 0000000..11b7bcc --- /dev/null +++ b/modules/home-manager/accounts/email/default.nix @@ -0,0 +1,222 @@ +{ lib, config, pkgs, inputs, ... }: +with lib; +let + cfg = config.modules.email; + secretsDirectory = "${(builtins.toString inputs.nix-private)}/secrets"; +in +{ + options.modules.email = { + enable = mkEnableOption "Enable email accounts configuration"; + + accountConfigs = mkOption { + type = types.attrsOf types.attrs; + default = false; + description = "List of account variables used to create accounts"; + }; + + primary = mkOption { + type = types.str; + default = false; + description = "name of primary account"; + }; + }; + + config = mkIf cfg.enable { + sops = let + secretList = lib.mapAttrs' ( name: value: + nameValuePair ( value.secret.key ) ({ + sopsFile = "${secretsDirectory}/${value.secret.file}"; + }) + ) cfg.accountConfigs; + in { + secrets = secretList; + }; + accounts.email = let + defaultSetting = { + mbsync = { + enable = true; + create = "maildir"; + expunge = "both"; + }; + msmtp = { + enable = true; + }; + notmuch = { + enable = true; + }; + neomutt = { + enable = true; + showDefaultMailbox = false; + }; + }; + accountsList = lib.mapAttrs ( name: value: lib.recursiveUpdate defaultSetting value.config ) cfg.accountConfigs; + in { + maildirBasePath = "mail"; + accounts = lib.recursiveUpdate accountsList { "${cfg.primary}".primary = true; }; + }; + + programs.afew = let + mailMoverRules = lib.mergeAttrsList ( + lib.attrsets.mapAttrsToList ( + n: v: + if lib.hasAttrByPath ["afew" "mailMover"] v then + v.afew.mailMover + else {} + ) cfg.accountConfigs); + in { + enable = true; + extraConfig = '' + [FolderNameFilter] + folder_explicit_list = archives + folder_transforms = archives:archive + maildir_separator = / + [MailMover] + folders = ${lib.concatStringsSep " " (lib.unique (lib.mapAttrsToList (n: v: "${n}") mailMoverRules))} + rename = True + ${lib.concatStringsSep "\n" (lib.mapAttrsToList (n: v: "${n} = ${toString v}") mailMoverRules)} + [SpamFilter] + [KillThreadsFilter] + [ArchiveSentMailsFilter] + sent_tag = sent + [InboxFilter] + ''; + }; + programs.neomutt = let + accountMacros = lib.imap1 ( + i: + elem: elem // { + map = ["index" "pager"]; + key = ""; + }) ( + lib.attrsets.mapAttrsToList ( + n: _: + { "action" = "source ~/.config/neomutt/${n}=InboxUnread";} + ) inputs.nix-private.mail); + in { + enable = true; + unmailboxes = true; + editor = "nvim +/^$/ +':nohl'"; + settings = { + sleep_time = "1"; + mbox_type = "Maildir"; + header_color_partial = "yes"; + duplicate_threads = "yes"; + index_format = "'%4C| %24.24?GS?%F %GS &%F? %?GR?%GR &%?GU?%GU & ??%?GA?%GA & ?%?GE?%GE & ?%?M?󰘕 %s&%s? %* %?g?  %g? %<[y?%<[m?%<[d?%9[%H:%M ]&%9[%a %d ]>&%9[%b %d ]>&%9[%m/%y ]>'"; + sort_aux = "last-date-sent"; + mail_check = "120"; + hidden_tags = "inbox,unread,draft,flagged,passed,replied,signed,encrypted,attachment,sent"; + markers = "no"; + wrap = "90"; + smart_wrap = "yes"; + reflow_text = "yes"; + reflow_wrap = "90"; + text_flowed = "yes"; + search_context = "3"; + pager_context = "5"; + pager_index_lines = "10"; + rfc2047_parameters = "yes"; + edit_headers = "yes"; + send_charset = "utf-8"; + envelope_from = "yes"; + my_status = "' %o/%m  | %l 󰉉 | %f %* Sort: %s-%S Pos: %P '"; + my_pager = "'  %F |  %s %* Pos: %P '"; + compose_format = "' COMPOSE  %a | 󰉉 %l'"; + query_command = "'${pkgs.khard}/bin/khard email --parsable --search-in-source-files %s'"; + }; + extraConfig = '' + ${(builtins.readFile ./files/theme.muttrc)} + charset-hook ^iso-8859-1$ cp1252 + ignore * + unignore from date subject to cc bcc tags user-agent x-mailer + auto_view text/x-vcard text/html text/enriched text/calendar + alternative_order text/html text/enriched text/plain text/* + tag-transforms "attachment" "󰁦" \ + "encrypted" "󱧈" \ + "signed" "󱅞" \ + "unread" "" \ + "replied" "" + tag-formats "attachment" "GA" \ + "encrypted" "GE" \ + "signed" "GS" \ + "unread" "GU" \ + "replied" "GR" + ''; + binds = [ + { map = [ "attach" "browser" "index" "pager" ]; key = "g"; action = "noop"; } + { map = [ "attach" "browser" "index" "pager" ]; key = "G"; action = "noop"; } + { map = [ "index" ]; key = "q"; action = "noop";} + { map = [ "pager" ]; key = "Q"; action = "noop";} + { map = [ "attach" "browser" "index" ]; key = "gg"; action = "first-entry";} + { map = [ "attach" "browser" "index" ]; key = "G"; action = "last-entry";} + { map = [ "pager" ]; key = "gg"; action = "top"; } + { map = [ "pager" ]; key = "G"; action = "bottom"; } + { map = [ "pager" ]; key = "k"; action = "previous-line"; } + { map = [ "pager" ]; key = "j"; action = "next-line"; } + + # Scrolling + { map = [ "attach" "browser" "pager" "index" ]; key = "\\CF"; action = "next-page";} + { map = [ "attach" "browser" "pager" "index" ]; key = "\\CB"; action = "previous-page";} + { map = [ "attach" "browser" "pager" "index" ]; key = "\\Cu"; action = "half-up";} + { map = [ "attach" "browser" "pager" "index" ]; key = "\\Cd"; action = "half-down";} + { map = [ "browser" "pager" ]; key = "\\Ce"; action = "next-line";} + { map = [ "browser" "pager" ]; key = "\\Cy"; action = "previous-line";} + { map = [ "index" ]; key = "\\Ce"; action = "next-line";} + { map = [ "index" ]; key = "\\Cy"; action = "previous-line";} + + # Delete + { map = [ "pager" "index" ]; key = "d "; action = "noop";} + { map = [ "pager" "index" ]; key = "dd "; action = "delete-message";} + + # Reply + { map =[ "pager" "index" ]; key = "R "; action = "group-reply";} + + # sidebar + { map = [ "index" "pager" ]; key = ""; action = "sidebar-toggle-visible";} + { map = [ "index" "pager" ]; key = "{"; action = "sidebar-prev";} + { map = [ "index" "pager" ]; key = "}"; action = "sidebar-next";} + { map = [ "index" "pager" ]; key = "|"; action = "sidebar-open";} + + # open virtual folder + { map = [ "index" "pager" ]; key = "X"; action = "noop";} + { map = [ "index" "pager" ]; key = "X"; action = "change-vfolder";} + + # read entire thread of the current message + { map = [ "index" "pager" ]; key = "+"; action = "entire-thread";} + + # generate virtual folder from query + { map = [ "index" "pager" ]; key = "\\eX"; action = "vfolder-from-query";} + + # generate virtual folder from query with time window + { map = [ "index" ]; key = "<"; action = "vfolder-window-backward";} + { map = [ "index" ]; key = ">"; action = "vfolder-window-forward";} + + { map = [ "index" "pager" ]; key = "\\CD"; action = "modify-tags";} + + # Editor + { map = [ "editor" ]; key = ""; action = "complete-query";} + { map = [ "editor" ]; key = "^T "; action = "complete";} + ]; + macros = [ + #Define some macros here + ] ++ accountMacros; + }; + programs.mbsync = { + enable = true; + }; + services.mbsync = { + enable = true; + postExec = "${pkgs.notmuch}/bin/notmuch new"; + }; + programs.notmuch = { + enable = true; + new.tags = [ "new" ]; + hooks.postNew = '' + ${pkgs.afew}/bin/afew --tag --new + ${pkgs.afew}/bin/afew --move --all + ''; + }; + programs.msmtp = { + enable = true; + }; + }; +} diff --git a/modules/home-manager/accounts/email/files/theme.muttrc b/modules/home-manager/accounts/email/files/theme.muttrc new file mode 100644 index 0000000..e7ea68c --- /dev/null +++ b/modules/home-manager/accounts/email/files/theme.muttrc @@ -0,0 +1,117 @@ +# vi: ft=muttrc +# base16-mutt: base16-shell support for mutt + +## Base +color normal color20 default # softer, bold + +## Weak +color tilde color08 default # `~` padding at the end of pager +color attachment color08 default +color tree color01 default # arrow in threads +color signature color08 default +color markers color08 default # `+` wrap indicator in pager + +color underline color21 default + +color error color01 default +color message color04 default # informational messages +color search color08 color03 +color status color20 color18 +color indicator color21 color19 # inverse, brighter + +color status color00 color06 ' Pos: ([[:alnum:]]|%)+ ' +color status color20 color19 ' Sort: ([[:alpha:]]|-)+ ' + +# Message Index ---------------------------------------------------------------- + +## Index parts +color index_number color20 default +color index_author color20 default +color index_date color20 default +color index_flags color20 default +color index_tag color20 default +color index_tags color20 default + +color index_author italic color06 default "~g !~V" +color index_author color04 default "~g ~V" + +color index_subject color04 default "~G" + +color index_date color08 default + +color index_number color08 default +color index_subject bold color07 default "(~U|~N|~O)" + +color index_author italic color00 color06 "~T" +color index_subject italic color00 color06 "~T" +color index_date italic color00 color06 "~T" +color index_tags italic color00 color06 "~T" +color index_tag italic color00 color06 "~T" + +color index_subject italic bold color00 default "~T (~U|~N|~O)" + +## Weak +color index color01 default "~v~(~F)" # collapsed thread with flagged inside + +# Selection +color index italic color00 color06 "~T" # tagged messages +color index color01 color18 "~D" # deleted messages + +### Message Headers ---------------------------------------------------- + +# Base +set header_color_partial +hdr_order From Date: From: To: Cc: Subject: + +color header color04 default '^[^[:blank:]:]*:' +color hdrdefault color20 default +color header color17 default "^[Date:] (.*)" +color header color04 default "^From:" +color header color05 default "^Tags:" +color header color16 default "^(To|Cc|CC|BCC):" +color header brightcolor07 default "^Subject: (.*)" + +color header color06 color00 "((@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]),)*@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]):)?[0-9a-z_.+%$-]+@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\])" + +### Message Body ------------------------------------------------------- +# When possible, these regular expressions attempt to match http://spec.commonmark.org/ +## Weak +# ~~~ Horizontal rules ~~~ +color body color08 color00 "([[:space:]]*[-+=#*~_]){3,}[[:space:]]*" +## Strong +# *Bold* span +color body brightcolor03 color00 "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)" +# _Underline_ span +color body color05 color00 "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)" +# /Italic/ span (Sometimes gets directory names) +color body color05 color00 "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)" +# ATX headers +color body color04 color00 "^[[:space:]]{0,3}#+[[:space:]].*$" +## Highlight +# `Code` span +color body color02 color00 "(^|[[:space:][:punct:]])\`[^\`]+\`([[:space:][:punct:]]|$)" +# Indented code block +color body color02 color00 "^[[:space:]]{4,}.*$" +# URLs +color body italic color04 color00 "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]" +# Email addresses +color body color06 color00 "((@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]),)*@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]):)?[0-9a-z_.+%$-]+@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\])" + +# Emoticons ;-P +color body black yellow "[;:][-o]?[})>{(<|P]" + +# PGP +color body color02 default "(Good signature)" +color body color01 default "(Bad signature)" +color body color16 default "(Problem signature)" +color body color04 color00 "^gpg: " + +## Quotation blocks +color quoted color06 color00 +color quoted1 color02 color00 +color quoted2 color03 color00 +color quoted3 color16 color00 +color quoted4 color01 color00 +color quoted5 color17 color00 +color quoted6 color05 color00 +color quoted7 color04 color00 diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index b17aa6f..ff73a9f 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -25,5 +25,6 @@ ./web/qutebrowser/default.nix ./web/webcord ./accounts/dav + ./accounts/email ]; } From f9ebf2368831abe823fc4e36bf85ca5f676676ff Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 5 Aug 2025 02:02:19 +0200 Subject: [PATCH 02/11] feat(accounts/mail): implement afew filters management --- flake.lock | 6 +++--- modules/home-manager/accounts/email/default.nix | 10 +++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 3176169..114cf11 100644 --- a/flake.lock +++ b/flake.lock @@ -61,10 +61,10 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1754265461, - "narHash": "sha256-qVA40ypUxsQR+kpzgqrsS2JrdwS6CI7JQcvpLjc+nlg=", + "lastModified": 1754351405, + "narHash": "sha256-q7KxXc9P60DAf2iUNXF42tUGkZErd0n59JuFxUMimlo=", "ref": "main", - "rev": "7ce0411fc0c480211951ef58b263c5eb72579681", + "rev": "cc10d2bdfb86551b7781041a1583388370da82cc", "shallow": true, "type": "git", "url": "ssh://git@git.epha.se:24422/ephase/nix-private.git" diff --git a/modules/home-manager/accounts/email/default.nix b/modules/home-manager/accounts/email/default.nix index 11b7bcc..af9d1b1 100644 --- a/modules/home-manager/accounts/email/default.nix +++ b/modules/home-manager/accounts/email/default.nix @@ -63,7 +63,14 @@ in v.afew.mailMover else {} ) cfg.accountConfigs); - in { + mailFilterRules = lib.flatten ( + lib.attrsets.mapAttrsToList ( + n: v: + if lib.hasAttrByPath ["afew" "filters"] v then + v.afew.filters + else [] + ) cfg.accountConfigs); + in { enable = true; extraConfig = '' [FolderNameFilter] @@ -79,6 +86,7 @@ in [ArchiveSentMailsFilter] sent_tag = sent [InboxFilter] + ${lib.concatImapStrings (p: e: "\n\n[Filter.${toString p}]\n ${lib.concatStringsSep "\n" (lib.mapAttrsToList (n: v: "${n} = ${v}") e)}") mailFilterRules} ''; }; programs.neomutt = let From dd5be819f24454edfa4749818bbc8860856b3e9d Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Wed, 6 Aug 2025 00:28:09 +0200 Subject: [PATCH 03/11] fix(neomutt): fix change account keybinding --- modules/home-manager/accounts/email/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/home-manager/accounts/email/default.nix b/modules/home-manager/accounts/email/default.nix index af9d1b1..3f5651d 100644 --- a/modules/home-manager/accounts/email/default.nix +++ b/modules/home-manager/accounts/email/default.nix @@ -99,7 +99,7 @@ in lib.attrsets.mapAttrsToList ( n: _: { "action" = "source ~/.config/neomutt/${n}=InboxUnread";} - ) inputs.nix-private.mail); + ) cfg.accountConfigs); in { enable = true; unmailboxes = true; From 28020e17e148619d3d84241ff394c9abf56a0f08 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Wed, 6 Aug 2025 00:29:28 +0200 Subject: [PATCH 04/11] chore(email): propagate email deletion --- modules/home-manager/accounts/email/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/home-manager/accounts/email/default.nix b/modules/home-manager/accounts/email/default.nix index 3f5651d..31ae461 100644 --- a/modules/home-manager/accounts/email/default.nix +++ b/modules/home-manager/accounts/email/default.nix @@ -37,6 +37,7 @@ in enable = true; create = "maildir"; expunge = "both"; + remove = "both"; }; msmtp = { enable = true; From fab0ec3696b8041673962a27c396fbe83da20e64 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Mon, 11 Aug 2025 00:06:36 +0200 Subject: [PATCH 05/11] feat(mail): add urlscan to view url in mails --- .../home-manager/accounts/email/default.nix | 1 + .../accounts/email/files/urlscan.config.json | 54 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 modules/home-manager/accounts/email/files/urlscan.config.json diff --git a/modules/home-manager/accounts/email/default.nix b/modules/home-manager/accounts/email/default.nix index 31ae461..13717e1 100644 --- a/modules/home-manager/accounts/email/default.nix +++ b/modules/home-manager/accounts/email/default.nix @@ -227,5 +227,6 @@ in programs.msmtp = { enable = true; }; + home.file."${config.xdg.configHome}/urlscan/config.json".source = ./files/urlscan.config.json; }; } diff --git a/modules/home-manager/accounts/email/files/urlscan.config.json b/modules/home-manager/accounts/email/files/urlscan.config.json new file mode 100644 index 0000000..961c5ce --- /dev/null +++ b/modules/home-manager/accounts/email/files/urlscan.config.json @@ -0,0 +1,54 @@ +{ + "palettes": { + "default": [ + [ "header", "white", "dark blue", "standout", "#d8d8d8", "#383838" ], + [ "footer", "white", "dark red", "standout", "#d8d8d8", "#383838" ], + [ "search", "white", "dark green", "standout", "#282828", "#f7ca88" ], + [ "msgtext", "", "", "", "", "" ], + [ "msgtext:ellipses", "light gray", "black", "bold", "#f7ca88", "#383838" ], + [ "urlref:number:braces", "light gray", "black", "bold", "#f8f8f8", "#383838"], + [ "urlref:number","yellow", "black","bold", "#f7ca88", "#383838" ], + [ "urlref:url", "white", "black", "italics", "#7cafc2", "#181818" ], + [ "url:sel", "white", "dark blue", "underline", "#7cafc2", "#383838" ] + ] + + }, + "keys": { + "/": "search_key", + "0": "digits", + "1": "digits", + "2": "digits", + "3": "digits", + "4": "digits", + "5": "digits", + "6": "digits", + "7": "digits", + "8": "digits", + "9": "digits", + "a": "add_url", + "C": "clipboard", + "c": "context", + "ctrl l": "clear_screen", + "ctrl f": "page_down", + "ctrl b": "page_up", + "d": "del_url", + "f1": "help_menu", + "G": "bottom", + "g": "top", + "j": "down", + "k": "up", + "J": "next", + "K": "previous", + "P": "clipboard_pri", + "l": "link_handler", + "o": "open_queue", + "O": "open_queue_win", + "p": "palette", + "Q": "quit", + "q": "quit", + "R": "reverse", + "S": "all_shorten", + "s": "shorten", + "u": "all_escape" + } +} From 30ebf1e5d058656f98cd99ced6fa6fc2524f29ed Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Mon, 11 Aug 2025 00:08:50 +0200 Subject: [PATCH 06/11] fix(mail): use email address suffix in inbox folder --- modules/home-manager/accounts/email/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/home-manager/accounts/email/default.nix b/modules/home-manager/accounts/email/default.nix index 13717e1..25bbde6 100644 --- a/modules/home-manager/accounts/email/default.nix +++ b/modules/home-manager/accounts/email/default.nix @@ -98,8 +98,8 @@ in key = ""; }) ( lib.attrsets.mapAttrsToList ( - n: _: - { "action" = "source ~/.config/neomutt/${n}=InboxUnread";} + n: c: + { "action" = "source ~/.config/neomutt/${n}Unread:${c.config.address}";} ) cfg.accountConfigs); in { enable = true; From a023323e3439192261e2d7f87d654fdc9cb6d7e9 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Mon, 11 Aug 2025 00:10:35 +0200 Subject: [PATCH 07/11] fix(mail): afew filters was never applied because misplaced --- modules/home-manager/accounts/email/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/home-manager/accounts/email/default.nix b/modules/home-manager/accounts/email/default.nix index 25bbde6..069583a 100644 --- a/modules/home-manager/accounts/email/default.nix +++ b/modules/home-manager/accounts/email/default.nix @@ -86,8 +86,8 @@ in [KillThreadsFilter] [ArchiveSentMailsFilter] sent_tag = sent - [InboxFilter] ${lib.concatImapStrings (p: e: "\n\n[Filter.${toString p}]\n ${lib.concatStringsSep "\n" (lib.mapAttrsToList (n: v: "${n} = ${v}") e)}") mailFilterRules} + [InboxFilter] ''; }; programs.neomutt = let From 97051b5cc27f514c9c1d81ede97a86b70f9694a5 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Mon, 11 Aug 2025 00:17:39 +0200 Subject: [PATCH 08/11] chore(mail): rework neomutt configuration * add mailcap to handle attachment * add per-account mutt hook * remove Trash folder sync and unassign Trash for each accounts * remove `dd` keybinding * add `Ctrl+b` macro to launch urlscan --- .../home-manager/accounts/email/default.nix | 56 +++++++++++++------ .../accounts/email/files/theme.muttrc | 35 +++++++----- 2 files changed, 58 insertions(+), 33 deletions(-) diff --git a/modules/home-manager/accounts/email/default.nix b/modules/home-manager/accounts/email/default.nix index 069583a..d9c1152 100644 --- a/modules/home-manager/accounts/email/default.nix +++ b/modules/home-manager/accounts/email/default.nix @@ -35,9 +35,14 @@ in defaultSetting = { mbsync = { enable = true; - create = "maildir"; + create = "both"; expunge = "both"; remove = "both"; + patterns = [ + "*" + # Trash is a pain in the ass to manage with notmuch + "!Trash" + ]; }; msmtp = { enable = true; @@ -76,7 +81,7 @@ in extraConfig = '' [FolderNameFilter] folder_explicit_list = archives - folder_transforms = archives:archive + folder_transforms = archives:archived maildir_separator = / [MailMover] folders = ${lib.concatStringsSep " " (lib.unique (lib.mapAttrsToList (n: v: "${n}") mailMoverRules))} @@ -104,13 +109,15 @@ in in { enable = true; unmailboxes = true; + changeFolderWhenSourcingAccount = true; + sourcePrimaryAccount = false; editor = "nvim +/^$/ +':nohl'"; settings = { sleep_time = "1"; mbox_type = "Maildir"; header_color_partial = "yes"; duplicate_threads = "yes"; - index_format = "'%4C| %24.24?GS?%F %GS &%F? %?GR?%GR &%?GU?%GU & ??%?GA?%GA & ?%?GE?%GE & ?%?M?󰘕 %s&%s? %* %?g?  %g? %<[y?%<[m?%<[d?%9[%H:%M ]&%9[%a %d ]>&%9[%b %d ]>&%9[%m/%y ]>'"; + index_format = "'%4C| %24.24?GS?%F %GS &%F? %?GD?%GD &%?GR?%GR &%?GU?%GU & ???%?GA?%GA & ?%?GE?%GE & ?%?M?󰘕 %s&%s? %* %?g?  %g? %<[y?%<[m?%<[d?%9[%H:%M ]&%9[%a %d ]>&%9[%b %d ]>&%9[%m/%y ]>'"; sort_aux = "last-date-sent"; mail_check = "120"; hidden_tags = "inbox,unread,draft,flagged,passed,replied,signed,encrypted,attachment,sent"; @@ -131,24 +138,37 @@ in my_pager = "'  %F |  %s %* Pos: %P '"; compose_format = "' COMPOSE  %a | 󰉉 %l'"; query_command = "'${pkgs.khard}/bin/khard email --parsable --search-in-source-files %s'"; + virtual_spoolfile = "yes"; + mail_check_stats = "yes"; + mh_purge = "yes"; + mailcap_path= "${config.xdg.configHome}/neomutt/mailcap"; }; extraConfig = '' ${(builtins.readFile ./files/theme.muttrc)} charset-hook ^iso-8859-1$ cp1252 ignore * + unignore from date subject to cc bcc tags user-agent x-mailer + + # Attachment auto_view text/x-vcard text/html text/enriched text/calendar alternative_order text/html text/enriched text/plain text/* - tag-transforms "attachment" "󰁦" \ + + tag-transforms "attachment" "󰁦" \ "encrypted" "󱧈" \ "signed" "󱅞" \ "unread" "" \ "replied" "" - tag-formats "attachment" "GA" \ - "encrypted" "GE" \ - "signed" "GS" \ - "unread" "GU" \ - "replied" "GR" + tag-formats "attachment" "GA" \ + "encrypted" "GE" \ + "signed" "GS" \ + "unread" "GU" \ + "replied" "GR" + + ${lib.concatStrings (lib.attrsets.mapAttrsToList ( _: v: if lib.hasAttrByPath [ "neomuttHooks" ] v then v.neomuttHooks else "" ) cfg.accountConfigs)} + # manually source first account instead of use home-manager parameter because + # of $my_pager expansion does not work as this variable is not already set + source ${config.xdg.configHome}/neomutt/${cfg.primary} ''; binds = [ { map = [ "attach" "browser" "index" "pager" ]; key = "g"; action = "noop"; } @@ -172,12 +192,8 @@ in { map = [ "index" ]; key = "\\Ce"; action = "next-line";} { map = [ "index" ]; key = "\\Cy"; action = "previous-line";} - # Delete - { map = [ "pager" "index" ]; key = "d "; action = "noop";} - { map = [ "pager" "index" ]; key = "dd "; action = "delete-message";} - # Reply - { map =[ "pager" "index" ]; key = "R "; action = "group-reply";} + { map =[ "pager" "index" ];gkey = "R"; action = "group-reply";} # sidebar { map = [ "index" "pager" ]; key = ""; action = "sidebar-toggle-visible";} @@ -196,17 +212,15 @@ in { map = [ "index" "pager" ]; key = "\\eX"; action = "vfolder-from-query";} # generate virtual folder from query with time window - { map = [ "index" ]; key = "<"; action = "vfolder-window-backward";} - { map = [ "index" ]; key = ">"; action = "vfolder-window-forward";} { map = [ "index" "pager" ]; key = "\\CD"; action = "modify-tags";} # Editor { map = [ "editor" ]; key = ""; action = "complete-query";} - { map = [ "editor" ]; key = "^T "; action = "complete";} + { map = [ "editor" ]; key = "^T"; action = "complete";} ]; macros = [ - #Define some macros here + { map = [ "pager" ]; key = "\\CB"; action = "${pkgs.urlscan}/bin/urlscan -d -c --color true"; } ] ++ accountMacros; }; programs.mbsync = { @@ -228,5 +242,11 @@ in enable = true; }; home.file."${config.xdg.configHome}/urlscan/config.json".source = ./files/urlscan.config.json; + xdg.configFile."neomutt/mailcap".text = '' + text/html; ${pkgs.xdg-utils}/bin/xdg-open %s; nametemplate=%html + text/html; ${pkgs.w3m}/bin/w3m -I %{charset} -cols 90 -T text/html %s; copiousoutput + application/pdf; ${pkgs.xdg-utils}/bin/xdg-open %s & + image/*; ${pkgs.xdg-utils}/bin/xdg-open %s & + ''; }; } diff --git a/modules/home-manager/accounts/email/files/theme.muttrc b/modules/home-manager/accounts/email/files/theme.muttrc index e7ea68c..e3e0baa 100644 --- a/modules/home-manager/accounts/email/files/theme.muttrc +++ b/modules/home-manager/accounts/email/files/theme.muttrc @@ -1,5 +1,4 @@ # vi: ft=muttrc -# base16-mutt: base16-shell support for mutt ## Base color normal color20 default # softer, bold @@ -30,7 +29,7 @@ color index_author color20 default color index_date color20 default color index_flags color20 default color index_tag color20 default -color index_tags color20 default +color index_tags italic color08 default color index_author italic color06 default "~g !~V" color index_author color04 default "~g ~V" @@ -48,14 +47,16 @@ color index_date italic color00 color06 "~T" color index_tags italic color00 color06 "~T" color index_tag italic color00 color06 "~T" +color index_subject color01 color18 "~D" # deleted messages + color index_subject italic bold color00 default "~T (~U|~N|~O)" ## Weak -color index color01 default "~v~(~F)" # collapsed thread with flagged inside +color index color01 default "~v~(~F)" # collapsed thread with flagged inside # Selection color index italic color00 color06 "~T" # tagged messages -color index color01 color18 "~D" # deleted messages +color index default color18 "~D" # deleted messages ### Message Headers ---------------------------------------------------- @@ -77,22 +78,26 @@ color header color06 color00 "((@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0- # When possible, these regular expressions attempt to match http://spec.commonmark.org/ ## Weak # ~~~ Horizontal rules ~~~ -color body color08 color00 "([[:space:]]*[-+=#*~_]){3,}[[:space:]]*" -## Strong +color body color08 default "([[:space:]]*[-+=#*~_]){3,}[[:space:]]*" + # *Bold* span -color body brightcolor03 color00 "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)" +color body brightcolor03 default "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)" + # _Underline_ span -color body color05 color00 "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)" +color body underline color20 default "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)" + # /Italic/ span (Sometimes gets directory names) -color body color05 color00 "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)" +color body italic color20 default "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)" + # ATX headers -color body color04 color00 "^[[:space:]]{0,3}#+[[:space:]].*$" -## Highlight +color body color04 default "^[[:space:]]{0,3}#+[[:space:]].*$" + # `Code` span -color body color02 color00 "(^|[[:space:][:punct:]])\`[^\`]+\`([[:space:][:punct:]]|$)" -# Indented code block -color body color02 color00 "^[[:space:]]{4,}.*$" -# URLs +color body color05 default "(^|[[:space:][:punct:]])\`[^\`]+\`([[:space:][:punct:]]|$)" + +color body bold color01 default "^(\\*[[:space:]])" + +## URI color body italic color04 color00 "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]" # Email addresses color body color06 color00 "((@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]),)*@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]):)?[0-9a-z_.+%$-]+@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\])" From 6ec9a0c4e5f815c9dea9471c8fa2734385b43242 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Mon, 11 Aug 2025 00:35:49 +0200 Subject: [PATCH 09/11] chore(morty): rework mail configuration --- hosts/morty/home-config.nix | 7 ++++--- modules/home-manager/accounts/email/default.nix | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hosts/morty/home-config.nix b/hosts/morty/home-config.nix index 17453be..ed063e5 100644 --- a/hosts/morty/home-config.nix +++ b/hosts/morty/home-config.nix @@ -3,10 +3,11 @@ email = { enable = true; accountConfigs = { - ubordeaux = inputs.nix-private.mail.ubordeaux; - xiemeart = inputs.nix-private.mail.xiemeart; + a = inputs.nix-private.mail.xiemeart; + b = inputs.nix-private.mail.ephase; + c = inputs.nix-private.mail.ubordeaux; }; - primary = "xiemeart"; + primary = "a"; }; application = { gnupg = { diff --git a/modules/home-manager/accounts/email/default.nix b/modules/home-manager/accounts/email/default.nix index d9c1152..0f9b089 100644 --- a/modules/home-manager/accounts/email/default.nix +++ b/modules/home-manager/accounts/email/default.nix @@ -117,7 +117,7 @@ in mbox_type = "Maildir"; header_color_partial = "yes"; duplicate_threads = "yes"; - index_format = "'%4C| %24.24?GS?%F %GS &%F? %?GD?%GD &%?GR?%GR &%?GU?%GU & ???%?GA?%GA & ?%?GE?%GE & ?%?M?󰘕 %s&%s? %* %?g?  %g? %<[y?%<[m?%<[d?%9[%H:%M ]&%9[%a %d ]>&%9[%b %d ]>&%9[%m/%y ]>'"; + index_format = "'%4C| %24.24?GS?%F %GS &%F? %?GR?%GR &%?GU?%GU & ??%?GA?%GA & ?%?GE?%GE & ?%?M?󰘕 %s&%s? %* %?g?  %g? %<[y?%<[m?%<[d?%9[%H:%M ]&%9[%a %d ]>&%9[%b %d ]>&%9[%m/%y ]>'"; sort_aux = "last-date-sent"; mail_check = "120"; hidden_tags = "inbox,unread,draft,flagged,passed,replied,signed,encrypted,attachment,sent"; @@ -193,7 +193,7 @@ in { map = [ "index" ]; key = "\\Cy"; action = "previous-line";} # Reply - { map =[ "pager" "index" ];gkey = "R"; action = "group-reply";} + { map =[ "pager" "index" ]; key = "R"; action = "group-reply";} # sidebar { map = [ "index" "pager" ]; key = ""; action = "sidebar-toggle-visible";} From 1e9f3ff797f5c78d4b80412cc0b7343c73046852 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Mon, 11 Aug 2025 01:35:42 +0200 Subject: [PATCH 10/11] chore: update nix-private repo --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 114cf11..ed17213 100644 --- a/flake.lock +++ b/flake.lock @@ -61,10 +61,10 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1754351405, - "narHash": "sha256-q7KxXc9P60DAf2iUNXF42tUGkZErd0n59JuFxUMimlo=", + "lastModified": 1754865211, + "narHash": "sha256-/J6DVTh9f2KXB9N6Dvdf/tZQjkwCzVNxztgNPl2wNVI=", "ref": "main", - "rev": "cc10d2bdfb86551b7781041a1583388370da82cc", + "rev": "bb8073a0dc9ac1299e73c4a576bbd9e1314483e6", "shallow": true, "type": "git", "url": "ssh://git@git.epha.se:24422/ephase/nix-private.git" From 55517dba816fc03fe000b35caf695da11c664584 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Mon, 11 Aug 2025 01:36:43 +0200 Subject: [PATCH 11/11] fix(tmux): unaccurate bell template --- modules/home-manager/cli/tmux/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/home-manager/cli/tmux/default.nix b/modules/home-manager/cli/tmux/default.nix index dbb44f4..a2748ba 100644 --- a/modules/home-manager/cli/tmux/default.nix +++ b/modules/home-manager/cli/tmux/default.nix @@ -74,14 +74,15 @@ in setw -g window-status-current-format '#[fg=colour18,bg=colour11] #I\ #[bg=colour19,fg=colour7,bold] #W\ - #{?window_active,󰎂 ,}#{?window_marked_flag,󰃃 ,}#{?window_activity_flag, ,}#{?window_silence_flag,󰝟 ,}#{?window_zoomed_flag,󱀅 ,}#{?window_bell_flag,#[fg=colour1]󱈸 ,}' + #{?window_active,󰎂 ,}#{?window_marked_flag,󰃃 ,}#{?window_activity_flag, ,}#{?window_silence_flag,󰝟 ,}#{?window_zoomed_flag,󱀅 ,}' set -g pane-border-style fg=colour19 set -g pane-active-border-style fg=colour4 setw -g window-status-format '#[bg=color12,fg=colour19] #I\ #[bg=colour18,fg=colour7,dim] #W\ - #{?window_last_flag, ,}#{?window_marked_flag,󰃃 ,}#{?window_activity_flag, ,}#{?window_silence_flag,󰝟 ,}#{?window_zoomed_flag,󱀅 ,}#{?window_bell_flag,#[fg=colour1]󱈸 ,}' + #{?window_last_flag, ,}#{?window_marked_flag,󰃃 ,}#{?window_activity_flag, ,}#{?window_silence_flag,󰝟 ,}#{?window_zoomed_flag,󱀅 ,}#{?window_bell_flag,#[bg=colour1]#[fg=colour15]#[none] ,}' + setw -g window-status-bell-style bg=colour18,fg=colour7 set -g status-left-length 100 set -g status-left '#[bg=colour0, fg=colour6]  #S ' set -g status-right ' '