1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-14 07:09:45 +01:00
home-manager/tests/modules/programs/neomutt/neomutt-not-primary.nix
Rodney Lorrimar cbf0667037
programs.neomutt: Fix eval error when primary account not enabled (#1873)
* neomutt: Fix eval error when primary account not enabled

If neomutt is enabled for an account, but not the primary account, the
configuration will fail with "list index 0 is out of bounds".

This adds the first neomutt-enabled account as a fallback.

* neomutt: add regression test/update tests
2021-03-29 00:44:47 -04:00

26 lines
583 B
Nix

{ config, lib, pkgs, ... }:
with lib;
{
imports = [ ../../accounts/email-test-accounts.nix ];
config = {
accounts.email.accounts = {
"hm@example.com".maildir = null;
hm-account.neomutt.enable = true;
};
programs.neomutt.enable = true;
nixpkgs.overlays =
[ (self: super: { neomutt = pkgs.writeScriptBin "dummy-neomutt" ""; }) ];
nmt.script = ''
assertFileExists home-files/.config/neomutt/neomuttrc
assertFileContent home-files/.config/neomutt/neomuttrc ${
./neomutt-not-primary-expected.conf
}
'';
};
}