diff options
Diffstat (limited to 'modules/home/git.nix')
| -rw-r--r-- | modules/home/git.nix | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/modules/home/git.nix b/modules/home/git.nix new file mode 100644 index 0000000..1915304 --- /dev/null +++ b/modules/home/git.nix @@ -0,0 +1,55 @@ +{ pkgs, ... }: + +{ + programs.git = { + enable = true; + + signing = if pkgs.stdenv.isDarwin then { + key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMCyUn5BfmAnd/6xi0X1mYF/+jPOmCS0bpNUePF55gCY"; + signByDefault = true; + } else { + signByDefault = false; + }; + + settings = { + user = { + name = "Simen A. W. Olsen"; + email = "hello@simenandre.no"; + }; + apply.whitespace = "fix"; + core = { + trustctime = false; + editor = "nvim"; + excludesfile = "~/.gitignore_global"; + }; + color.ui = "auto"; + "color \"branch\"" = { + current = "yellow reverse"; + local = "yellow"; + remote = "green"; + }; + "color \"diff\"" = { + meta = "yellow bold"; + frag = "magenta bold"; + old = "red"; + new = "green"; + }; + "color \"status\"" = { + added = "yellow"; + changed = "green"; + untracked = "cyan"; + }; + diff.renames = "copies"; + help.autocorrect = 1; + merge.log = true; + push.autoSetupRemote = true; + github.user = "simenandre"; + pull.rebase = true; + } // (if pkgs.stdenv.isDarwin then { + gpg.format = "ssh"; + "gpg \"ssh\"".program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign"; + "url \"ssh://git@github.com/\"".insteadOf = "https://github.com/"; + commit.gpgsign = true; + } else {}); + }; +} |
