2019-01-29 17:17:24 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
2019-12-08 20:39:45 +00:00
|
|
|
imports = [ ../../accounts/email-test-accounts.nix ];
|
2019-01-29 17:17:24 +00:00
|
|
|
|
|
|
|
config = {
|
2021-03-04 02:24:19 +00:00
|
|
|
accounts.email.accounts.hm-account.smtp.tls.certificatesFile =
|
|
|
|
"/etc/test/certificates.crt";
|
2019-01-29 17:17:24 +00:00
|
|
|
programs.git = {
|
|
|
|
enable = true;
|
2019-10-08 20:46:27 +00:00
|
|
|
package = pkgs.gitMinimal;
|
2019-01-29 17:17:24 +00:00
|
|
|
userEmail = "hm@example.com";
|
|
|
|
userName = "H. M. Test";
|
|
|
|
};
|
|
|
|
|
2020-07-20 12:54:18 +00:00
|
|
|
home.stateVersion = "20.09";
|
|
|
|
|
2019-01-29 17:17:24 +00:00
|
|
|
nmt.script = ''
|
|
|
|
function assertGitConfig() {
|
|
|
|
local value
|
2020-11-14 22:18:07 +00:00
|
|
|
value=$(${pkgs.gitMinimal}/bin/git config \
|
2019-01-29 17:17:24 +00:00
|
|
|
--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
|
2020-02-01 23:39:17 +00:00
|
|
|
assertFileContent home-files/.config/git/config ${
|
|
|
|
./git-with-email-expected.conf
|
|
|
|
}
|
2019-01-29 17:17:24 +00:00
|
|
|
|
2024-05-06 06:17:53 +00:00
|
|
|
assertGitConfig "sendemail.hm@example.com.from" "H. M. Test <hm@example.com>"
|
|
|
|
assertGitConfig "sendemail.hm-account.from" "H. M. Test Jr. <hm@example.org>"
|
2019-01-29 17:17:24 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|