fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Andrew Fontainegit: Add configured SSL certificate for SMTP (#1833)39e49918

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