about summary refs log tree commit diff
path: root/modules/shell
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-03-15 21:19:20 +0000
committerAlyssa Ross <hi@alyssa.is>2019-03-15 21:19:20 +0000
commitf100aa70d9de357c04bb97b7fe28c3751ecd2e0e (patch)
tree865705ab2efcad10812f29792ae0be17a7d19e00 /modules/shell
parentd8455e1939267fca4ca19416de0361075c796040 (diff)
downloadnixlib-f100aa70d9de357c04bb97b7fe28c3751ecd2e0e.tar
nixlib-f100aa70d9de357c04bb97b7fe28c3751ecd2e0e.tar.gz
nixlib-f100aa70d9de357c04bb97b7fe28c3751ecd2e0e.tar.bz2
nixlib-f100aa70d9de357c04bb97b7fe28c3751ecd2e0e.tar.lz
nixlib-f100aa70d9de357c04bb97b7fe28c3751ecd2e0e.tar.xz
nixlib-f100aa70d9de357c04bb97b7fe28c3751ecd2e0e.tar.zst
nixlib-f100aa70d9de357c04bb97b7fe28c3751ecd2e0e.zip
modules/git: configure email sending
Diffstat (limited to 'modules/shell')
-rw-r--r--modules/shell/git/config.in2
-rw-r--r--modules/shell/git/default.nix14
2 files changed, 14 insertions, 2 deletions
diff --git a/modules/shell/git/config.in b/modules/shell/git/config.in
index 3988a18d86d5..7c039ae0a45e 100644
--- a/modules/shell/git/config.in
+++ b/modules/shell/git/config.in
@@ -52,3 +52,5 @@
     tool = opendiff
 [push]
     default = current
+[sendemail]
+    smtpServer = @smtpServer@
diff --git a/modules/shell/git/default.nix b/modules/shell/git/default.nix
index 2e872ecaa85f..2f61a984aff3 100644
--- a/modules/shell/git/default.nix
+++ b/modules/shell/git/default.nix
@@ -9,9 +9,17 @@ let
     chmod +x $out
   '';
 
+  # Git only supports absolute paths for this, so give it a wrapper
+  # program that execs the msmtp in PATH.
+  sendmail = pkgs.writeScript "git-sendmail" ''
+    #! ${pkgs.execline}/bin/execlineb -S0
+    msmtp $@
+  '';
+
   config = pkgs.runCommand "gitconfig" {
     inherit mozlz4_textconv;
     python = pkgs.python3;
+    smtpServer = sendmail;
     attributesfile = ./attributes;
     ignorefile = ./ignore;
     preferLocalBuild = true;
@@ -21,8 +29,10 @@ let
 
 in
 {
-  environment.systemPackages = with pkgs; with gitAndTools;
-    [ gitSVN git-remote-hg ];
+  environment.systemPackages = with pkgs; with gitAndTools; [
+    (git.override { svnSupport = true; sendEmailSupport = true; })
+    git-remote-hg
+  ];
 
   xdg.config.users.qyliss.paths."git/config" = config;
 }