mu: allow option to set muhome
Allows for the database path for mu to be configured. Useful for keeping the maildir and mu xapian cache together without having to modify XDG_CACHE_HOME. Add test to check for custom home setting. Fixes #5534
This commit is contained in:
parent
0b8df9eeb6
commit
bb14224f51
4 changed files with 46 additions and 5 deletions
|
|
@ -19,6 +19,6 @@
|
|||
'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;'
|
||||
'run @mu@/bin/mu init --maildir=/home/hm-user/Mail --muhome "/home/hm-user/.cache/mu" --my-address=foo@example.com --my-address=hm@example.com $VERBOSE_ARG;'
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
25
tests/modules/programs/mu/custom-configuration.nix
Normal file
25
tests/modules/programs/mu/custom-configuration.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ config, ... }: {
|
||||
imports = [ ../../accounts/email-test-accounts.nix ];
|
||||
|
||||
accounts.email.accounts = {
|
||||
"hm@example.com" = {
|
||||
mu.enable = true;
|
||||
aliases = [ "foo@example.com" ];
|
||||
};
|
||||
};
|
||||
|
||||
programs.mu = {
|
||||
enable = true;
|
||||
home = config.xdg.dataHome + "/mu";
|
||||
};
|
||||
|
||||
test.stubs.mu = { name = "mu"; };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContains activate \
|
||||
'if [[ ! -d "/home/hm-user/.local/share/mu" || ! "$MU_SORTED_ADDRS" = "foo@example.com hm@example.com" ]]; then'
|
||||
|
||||
assertFileContains activate \
|
||||
'run @mu@/bin/mu init --maildir=/home/hm-user/Mail --muhome "/home/hm-user/.local/share/mu" --my-address=foo@example.com --my-address=hm@example.com $VERBOSE_ARG;'
|
||||
'';
|
||||
}
|
||||
|
|
@ -1 +1,4 @@
|
|||
{ mu-basic-configuration = ./basic-configuration.nix; }
|
||||
{
|
||||
mu-basic-configuration = ./basic-configuration.nix;
|
||||
mu-custom-configuration = ./custom-configuration.nix;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue