mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 06:59:45 +01:00
39e4991856
If you have a custom SSL certificate configured for SMTP TLS, git should use it.
40 lines
1 KiB
Nix
40 lines
1 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
{
|
|
imports = [ ../../accounts/email-test-accounts.nix ];
|
|
|
|
config = {
|
|
accounts.email.accounts.hm-account.smtp.tls.certificatesFile =
|
|
"/etc/test/certificates.crt";
|
|
programs.git = {
|
|
enable = true;
|
|
package = pkgs.gitMinimal;
|
|
userEmail = "hm@example.com";
|
|
userName = "H. M. Test";
|
|
};
|
|
|
|
home.stateVersion = "20.09";
|
|
|
|
nmt.script = ''
|
|
function assertGitConfig() {
|
|
local value
|
|
value=$(${pkgs.gitMinimal}/bin/git config \
|
|
--file $TESTED/home-files/.config/git/config \
|
|
--get $1)
|
|
if [[ $value != $2 ]]; then
|
|
fail "Expected option '$1' to have value '$2' but it was '$value'"
|
|
fi
|
|
}
|
|
|
|
assertFileExists home-files/.config/git/config
|
|
assertFileContent home-files/.config/git/config ${
|
|
./git-with-email-expected.conf
|
|
}
|
|
|
|
assertGitConfig "sendemail.hm@example.com.from" "hm@example.com"
|
|
assertGitConfig "sendemail.hm-account.from" "hm@example.org"
|
|
'';
|
|
};
|
|
}
|