1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-27 04:09:47 +01:00
home-manager/tests/modules/programs/mu/basic-configuration.nix
VojtechStep 7349b01505
mu: reinitialize when personal addresses change
When the user changes which addresses mu should consider 'personal',
mu's store should be reinitialized.

After this change, the activation script parses the previously
configured list of addresses and compares it with the new one. If they
differ, it runs the init command even when the store has already been
initialized.
2024-12-23 09:52:16 +01:00

24 lines
604 B
Nix

{ ... }:
{
imports = [ ../../accounts/email-test-accounts.nix ];
accounts.email.accounts = {
"hm@example.com" = {
mu.enable = true;
aliases = [ "foo@example.com" ];
};
};
programs.mu.enable = true;
test.stubs.mu = { name = "mu"; };
nmt.script = ''
assertFileContains activate \
'if [[ ! -d "/home/hm-user/.cache/mu" || ! "$MU_SORTED_ADDRS" = "foo@example.com hm@example.com" ]]; then'
assertFileContains activate \
'run @mu@/bin/mu init --maildir=/home/hm-user/Mail --my-address=foo@example.com --my-address=hm@example.com $VERBOSE_ARG;'
'';
}