fork/home-manager
git clone https://git.julia.blue/fork/home-manager
c59f0eac
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5{ 6imports = [ ../../accounts/email-test-accounts.nix ]; 7 8test . asserts . warnings . expected = [ 9"mbsync channels no longer use masterPattern. Use farPattern in its place." 10"mbsync channels no longer use slavePattern. Use nearPattern in its place." 11]; 12 13config = { 14programs . mbsync = { 15enable = true ; 16# programs.mbsync.groups and 17# accounts.email.accounts.<name>.mbsync.groups should NOT be used at the 18# same time. 19# If they are, then the new version will take precedence. 20groups . inboxes = { 21"hm@example.com" = [ "Inbox1" "Inbox2" ]; 22hm-account = [ "Inbox" ]; 23}; 24}; 25 26accounts . . accounts = { 27"hm@example.com" . mbsync = { 28enable = true ; 29groups . inboxes = { 30channels = { 31inbox1 = { 32farPattern = "Inbox1" ; 33nearPattern = "Inboxes" ; 34}; 35inbox2 = { 36farPattern = "Inbox2" ; 37nearPattern = "Inboxes" ; 38}; 39}; 40}; 41}; 42 43hm-account . mbsync = { 44enable = true ; 45groups . hm-account = { 46channels . earlierPatternMatch = { 47farPattern = "Label" ; 48nearPattern = "SomethingUnderLabel" ; 49patterns = [ 50"ThingUnderLabel" 51"!NotThisMaildirThough" 52''"[Weird] Label?"'' 53]; 54}; 55channels . inbox = { 56farPattern = "Inbox" ; 57nearPattern = "Inbox" ; 58}; 59channels . strangeHostBoxName = { 60farPattern = "[Weird]/Label Mess" ; 61nearPattern = "[AnotherWeird]/Label" ; 62}; 63channels . patternMatch = { 64farPattern = "Label" ; 65nearPattern = "SomethingUnderLabel" ; 66patterns = [ 67"ThingUnderLabel" 68"!NotThisMaildirThough" 69''"[Weird] Label?"'' 70]; 71}; 72}; 73# No group should be printed. 74groups . emptyGroup = { }; 75# Group should be printed, but left with default channels. 76groups . emptyChannels = { 77channels . empty1 = { }; 78channels . empty2 = { }; 79}; 80}; 81}; 82 83test . asserts . warnings . expected = [ 84"mbsync channels no longer use masterPattern. use farPattern in its place." 85"mbsync channels no longer use slavePattern. Use nearPattern in its place." 86]; 87 88test . stubs . isync = { }; 89 90nmt . script = '' 91assertFileExists home-files/.mbsyncrc 92assertFileContent home-files/.mbsyncrc ${ ./mbsync-expected.conf } 93'' ; 94}; 95}