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";
|
|
|
|
};
|
|
|
|
|
2020-07-20 14:54:18 +02:00
|
|
|
home.stateVersion = "20.09";
|
|
|
|
|
2019-01-29 18:17:24 +01:00
|
|
|
nmt.script = ''
|
|
|
|
function assertGitConfig() {
|
|
|
|
local value
|
2020-11-14 23:18:07 +01:00
|
|
|
value=$(${pkgs.gitMinimal}/bin/git config \
|
2019-01-29 18:17:24 +01: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-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"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|