2019-01-29 18:17:24 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
2019-12-08 21:39:45 +01:00
|
|
|
imports = [ ../../accounts/email-test-accounts.nix ];
|
2019-01-29 18:17:24 +01:00
|
|
|
|
|
|
|
config = {
|
|
|
|
programs.git = {
|
|
|
|
enable = true;
|
2019-10-08 22:46:27 +02:00
|
|
|
package = pkgs.gitMinimal;
|
2019-01-29 18:17:24 +01:00
|
|
|
userEmail = "hm@example.com";
|
|
|
|
userName = "H. M. Test";
|
|
|
|
};
|
|
|
|
|
|
|
|
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-02 00:39:17 +01:00
|
|
|
assertFileContent home-files/.config/git/config ${
|
|
|
|
./git-with-email-expected.conf
|
|
|
|
}
|
2019-01-29 18:17:24 +01:00
|
|
|
|
|
|
|
assertGitConfig "sendemail.hm@example.com.from" "hm@example.com"
|
|
|
|
assertGitConfig "sendemail.hm-account.from" "hm@example.org"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|