fork/home-manager
git clone https://git.julia.blue/fork/home-manager
39e49918
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5{ 6imports = [ ../../accounts/email-test-accounts.nix ]; 7 8config = { 9accounts . . accounts . hm-account . smtp . tls . certificatesFile = 10"/etc/test/certificates.crt" ; 11programs . git = { 12enable = true ; 13package = pkgs . gitMinimal ; 14userEmail = "hm@example.com" ; 15userName = "H. M. Test" ; 16}; 17 18home . stateVersion = "20.09" ; 19 20nmt . script = '' 21function assertGitConfig() { 22local value 23value =$( ${ pkgs . gitMinimal } /bin/git config \ 24--file $ TESTED /home-files/.config/git/config \ 25--get $ 1 ) 26if [[ $ value != $ 2 ]]; then 27fail "Expected option ' $ 1 ' to have value ' $ 2 ' but it was ' $ value '" 28fi 29} 30 31assertFileExists home-files/.config/git/config 32assertFileContent home-files/.config/git/config ${ 33./git-with-email-expected.conf 34} 35 36assertGitConfig "sendemail.hm@example.com.from" "hm@example.com" 37assertGitConfig "sendemail.hm-account.from" "hm@example.org" 38'' ; 39}; 40}