From 2e473a7b0903709817b1b8cf0ef0cae1defac358 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Sat, 16 Apr 2022 16:36:31 -0600 Subject: [PATCH] neomutt/signature: unset if disabled (#2877) Closes #2876 --- modules/programs/neomutt.nix | 6 ++++-- tests/modules/programs/neomutt/hm-example.com-expected | 1 + .../programs/neomutt/hm-example.com-gpg-expected.conf | 1 + .../programs/neomutt/hm-example.com-msmtp-expected.conf | 1 + .../neomutt/hm-example.com-no-folder-change-expected.conf | 1 + 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/programs/neomutt.nix b/modules/programs/neomutt.nix index 562763bdd..b3e928183 100644 --- a/modules/programs/neomutt.nix +++ b/modules/programs/neomutt.nix @@ -223,9 +223,11 @@ let # Extra configuration ${account.neomutt.extraConfig} - '' + optionalString (account.signature.showSignature != "none") '' + '' + (if (account.signature.showSignature == "none") then '' + unset signature + '' else '' set signature = ${pkgs.writeText "signature.txt" account.signature.text} - '' + optionalString account.notmuch.enable (notmuchSection account); + '') + optionalString account.notmuch.enable (notmuchSection account); in { options = { diff --git a/tests/modules/programs/neomutt/hm-example.com-expected b/tests/modules/programs/neomutt/hm-example.com-expected index 6c96f61f4..74fbf6b1a 100644 --- a/tests/modules/programs/neomutt/hm-example.com-expected +++ b/tests/modules/programs/neomutt/hm-example.com-expected @@ -31,6 +31,7 @@ set trash='+Trash' # Extra configuration color status cyan default +unset signature # notmuch section set nm_default_uri = "notmuch:///home/hm-user/Mail" virtual-mailboxes "My INBOX" "notmuch://?query=tag:inbox" diff --git a/tests/modules/programs/neomutt/hm-example.com-gpg-expected.conf b/tests/modules/programs/neomutt/hm-example.com-gpg-expected.conf index f7763dbe6..8c5c10439 100644 --- a/tests/modules/programs/neomutt/hm-example.com-gpg-expected.conf +++ b/tests/modules/programs/neomutt/hm-example.com-gpg-expected.conf @@ -30,3 +30,4 @@ set trash='+Trash' # Extra configuration +unset signature diff --git a/tests/modules/programs/neomutt/hm-example.com-msmtp-expected.conf b/tests/modules/programs/neomutt/hm-example.com-msmtp-expected.conf index d2e2f3eee..8ccd3629a 100644 --- a/tests/modules/programs/neomutt/hm-example.com-msmtp-expected.conf +++ b/tests/modules/programs/neomutt/hm-example.com-msmtp-expected.conf @@ -30,3 +30,4 @@ set trash='+Trash' # Extra configuration color status cyan default +unset signature diff --git a/tests/modules/programs/neomutt/hm-example.com-no-folder-change-expected.conf b/tests/modules/programs/neomutt/hm-example.com-no-folder-change-expected.conf index 03ea3b31a..22fcf7884 100644 --- a/tests/modules/programs/neomutt/hm-example.com-no-folder-change-expected.conf +++ b/tests/modules/programs/neomutt/hm-example.com-no-folder-change-expected.conf @@ -28,3 +28,4 @@ set trash='+Trash' # Extra configuration +unset signature