nixos-configs/homeManagerModules/shell/git/default.nix

70 lines
1.6 KiB
Nix
Raw Normal View History

self: {
config,
lib,
pkgs,
...
2024-06-23 13:21:02 -04:00
}: let
inherit (lib) mkIf;
cfg = config.programs.bash;
2024-06-23 13:21:02 -04:00
mkRemoteConf = remote: email: name: {
condition = "hasconfig:remote.*.url:${remote}:*/**";
contents.user = {inherit email name;};
};
mkDefaultRemote = remote: mkRemoteConf remote "matt@nelim.org" "matt1432";
in {
config.programs = mkIf cfg.enable {
2023-10-15 16:41:34 -04:00
git = {
enable = true;
2024-08-10 21:53:54 -04:00
package = pkgs.gitFull;
2023-10-15 16:41:34 -04:00
lfs.enable = true;
includes = [
{path = toString self.scopedPackages.${pkgs.system}.dracula.git;}
2024-06-23 13:21:02 -04:00
(mkDefaultRemote "https://github.com")
(mkDefaultRemote "git@github.com")
(mkDefaultRemote "git@git.nelim.org")
2024-06-23 13:21:02 -04:00
(mkRemoteConf "git@gitlab.info.uqam.ca" "gj591944@ens.uqam.ca" "Mathis Hurtubise")
2023-10-15 16:41:34 -04:00
];
delta = {
enable = true;
options = {
side-by-side = true;
2024-08-10 21:53:54 -04:00
line-numbers-zero-style = "#E6EDF3";
};
};
2024-03-01 01:34:59 -05:00
extraConfig = {
diff.sopsdiffer.textconv = "sops --config /dev/null -d";
# https://github.com/dandavison/delta/issues/630#issuecomment-860046929
pager = let
cmd = "LESS='LRc --mouse' ${pkgs.delta}/bin/delta";
in {
diff = cmd;
show = cmd;
stash = cmd;
log = cmd;
reflog = cmd;
};
2024-08-10 21:53:54 -04:00
sendemail = {
smtpserver = "127.0.0.1";
smtpuser = "matt@nelim.org";
smtpencryption = "tls";
smtpserverport = 1025;
smtpsslcertpath = "";
};
};
2023-10-15 16:41:34 -04:00
};
};
# For accurate stack trace
_file = ./default.nix;
2023-10-15 16:41:34 -04:00
}