1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-30 06:59:45 +01:00

mu: add package option (#4325)

This commit is contained in:
Jian Lin 2023-08-10 00:40:43 +08:00 committed by GitHub
parent 7b8d43fbaf
commit a8f8f48320
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View file

@ -29,6 +29,8 @@ in {
programs.mu = { programs.mu = {
enable = mkEnableOption "mu, a maildir indexer and searcher"; enable = mkEnableOption "mu, a maildir indexer and searcher";
package = mkPackageOption pkgs "mu" { };
# No options/config file present for mu, and program author will not be # No options/config file present for mu, and program author will not be
# adding one soon. See https://github.com/djcb/mu/issues/882 for more # adding one soon. See https://github.com/djcb/mu/issues/882 for more
# information about this. # information about this.
@ -42,7 +44,7 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = [ pkgs.mu ]; home.packages = [ cfg.package ];
home.activation.runMuInit = let home.activation.runMuInit = let
maildirOption = genCmdMaildir config.accounts.email.maildirBasePath; maildirOption = genCmdMaildir config.accounts.email.maildirBasePath;
@ -52,7 +54,9 @@ in {
# In theory, mu is the only thing that creates that directory, and it is # In theory, mu is the only thing that creates that directory, and it is
# only created during the initial index. # only created during the initial index.
if [[ ! -d "${dbLocation}" ]]; then if [[ ! -d "${dbLocation}" ]]; then
$DRY_RUN_CMD ${pkgs.mu}/bin/mu init ${maildirOption} ${myAddresses} $VERBOSE_ARG; $DRY_RUN_CMD ${
getExe cfg.package
} init ${maildirOption} ${myAddresses} $VERBOSE_ARG;
fi fi
''; '';
}; };

View file

@ -12,7 +12,7 @@
programs.mu.enable = true; programs.mu.enable = true;
test.stubs.mu = { }; test.stubs.mu = { name = "mu"; };
nmt.script = '' nmt.script = ''
assertFileContains activate \ assertFileContains activate \