diff options
Diffstat (limited to 'user/modules')
-rw-r--r-- | user/modules/git.nix | 73 | ||||
-rw-r--r-- | user/modules/satoshipay.nix | 19 |
2 files changed, 89 insertions, 3 deletions
diff --git a/user/modules/git.nix b/user/modules/git.nix index a43ccadf..3c3f79bf 100644 --- a/user/modules/git.nix +++ b/user/modules/git.nix @@ -1,8 +1,75 @@ { config, pkgs, ... }: { - xdg.configFile.git = { - recursive = true; - source = ../git/.config/git; + home.packages = with pkgs; [ + gitAndTools.git-extras + ]; + programs.git = { + enable = true; + userName = "Alan Pearce"; + userEmail = "alan@alanpearce.eu"; + extraConfig = { + pull = { + rebase = true; + }; + push = { + default = "current"; + followTags = true; + }; + rebase = { + autosquash = true; + }; + rerere = { + enable = true; + }; + diff = { + algorithm = "patience"; + tool = "icdiff"; + }; + difftool = { + prompt = false; + }; + "difftool.icdiff" = { + cmd = "${pkgs.icdiff}/bin/icdiff --line-numbers $LOCAL $REMOTE"; + }; + "difftool.sopsdiffer" = { + textconf = "${pkgs.sops}/bin/sops -d"; + }; + "merge.npm-merge-driver" = { + name = "automatically merge npm lockfiles"; + driver = "npx npm-merge-driver merge %A %O %B %P"; + }; + remote = { + autoSetupMerge = true; + }; + "branch.master" = { + rebase = false; + }; + }; + signing = { + key = "0xCD4BEB92A8D46583"; + }; + lfs = { + enable = true; + }; + aliases = { + up = "merge FETCH_HEAD"; + st = "status -sb"; + ci = "commit"; + br = "branch"; + co = "checkout"; + lasttag = "!sh -c 'git tag --sort=version:refname | grep \"^v\\\\?[0-9]\" | tail -n1'"; + pending = "!sh -c 'git log --oneline --grep=\"#\" ...$(git lasttag)'"; + lg = "log --pretty=format:'%Cred%h%Creset -%Creset %s %Cgreen(%cr) %C(bold blue)<%an> %Cred%d%Creset'"; + prl = "log --pretty=format:'%Cred%h%Creset -%Creset %s %Cgreen(%cr) %C(bold blue)<%an> %Cred%d%Creset' --grep='#'"; + ignored = "ls-files --others -i --exclude-standard"; + }; + ignores = [ + ".DS_Store" + "*_flymake.*" + "*~" + "\#*\#" + ".\#*" + ]; }; } diff --git a/user/modules/satoshipay.nix b/user/modules/satoshipay.nix new file mode 100644 index 00000000..6feefbbb --- /dev/null +++ b/user/modules/satoshipay.nix @@ -0,0 +1,19 @@ +{ config, pkgs, ... }: + +let + spGitConfig = { + user.email = "alan@satoshipay.io"; + }; +in +{ + programs.git.includes = [ + { + condition = "gitdir:~/projects/github.com/satoshipay/"; + contents = spGitConfig; + } + { + condition = "gitdir:~/projects/gitlab.satoshipay.tech"; + contents = spGitConfig; + } + ]; +} |