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