default.nix (2270B)
1 { 2 lib, 3 config, 4 pkgs, 5 6 user, 7 ... 8 }: 9 { 10 imports = [ 11 ./filters.nix 12 ./binds.nix 13 ]; 14 15 config = { 16 environment.persistence."/fix".users.${user}.directories = [ 17 { 18 directory = ".cache/aerc"; 19 mode = "0700"; 20 } 21 ]; 22 23 home-manager.users.${user} = { 24 options.accounts.email.accounts = lib.mkOption { 25 type = lib.types.attrsOf ( 26 lib.types.submodule ( 27 { config, ... }: 28 { 29 config.aerc = { 30 enable = true; 31 extraAccounts = lib.mkIf (config.signature.showSignature == "append") { 32 signature-file = 33 builtins.toFile (lib.strings.sanitizeDerivationName "${config.address}-signature") 34 ( 35 lib.concatStrings [ 36 config.signature.delimiter 37 config.signature.text 38 ] 39 ); 40 signature-cmd = lib.mkIf (config.signature.command != null) config.signature.command; 41 enable-folders-sort = true; 42 folders-sort = [ 43 "INBOX" 44 "Important" 45 "Archive" 46 "Drafts" 47 "Sent" 48 "Spam" 49 ]; 50 }; 51 }; 52 } 53 ) 54 ); 55 }; 56 57 config = { 58 programs.aerc = { 59 enable = true; 60 extraConfig = { 61 general.unsafe-accounts-conf = true; 62 63 ui = { 64 mouse-enabled = true; 65 dirlist-tree = true; 66 fuzzy-complete = true; 67 sort = "-r arrival"; 68 dirlist-right = ''{{if .Unread}}{{humanReadable .Unread}} {{end}}{{.Style (humanReadable .Exists) "dim"}}''; 69 }; 70 71 openers = { 72 "text/html" = "firefox"; 73 "application/pdf" = "firefox"; 74 }; 75 76 compose = { 77 focus-body = true; 78 edit-headers = true; 79 reply-to-self = false; 80 }; 81 }; 82 stylesets = { 83 default.user."dim.dim" = true; 84 }; 85 }; 86 }; 87 }; 88 }; 89 }