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 = {
|
|
|
|
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
|
|
|
|
value=$(${pkgs.git}/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
|
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
|
|
|
|
|
|
|
assertGitConfig "sendemail.hm@example.com.from" "hm@example.com"
|
|
|
|
assertGitConfig "sendemail.hm-account.from" "hm@example.org"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|