Something went wrong. Try again.
My macOS dotfiles
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142{ inputs, ... }:{ flake.modules.homeManager.base = { config, lib, pkgs, ... }: { my.git.allowedSignersFile = pkgs.writeText "allowed_signers" ( lib.concatMapStringsSep "\n" (key: "${config.my.git.email} ${key}") config.my.git.allowedSigners );
programs.git = { enable = true; maintenance.enable = true; lfs.enable = true;
signing = { format = "ssh"; key = config.my.git.signingKey; signByDefault = true; signer = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign"; };
ignores = lib.splitString "\n" (builtins.readFile (inputs.self + "/.config/git/ignore"));
attributes = [ "* text=auto" ];
settings = { user = { name = config.my.git.user; email = config.my.git.email; };
core = { autocrlf = false; # leave line endings untouched whitespace = "error"; # flag whitespace errors in diff/apply preloadIndex = true; # parallel index preload, faster status untrackedCache = true; # cache untracked files };
alias = { st = "status -s"; lol = "log --oneline --graph --all"; };
push = { default = "simple"; # push current branch to its upstream autoSetupRemote = true; followTags = true; # push annotated tags alongside commits };
pull.rebase = true;
fetch = { prune = true; # drop refs for deleted remote branches pruneTags = true; # drop deleted remote tags all = true; # fetch from all remotes writeCommitGraph = true; # maintain commit-graph for faster traversal fsckObjects = true; # verify object integrity on fetch };
rebase = { autoStash = true; # stash/unstash dirty tree around rebase autoSquash = true; # honour fixup!/squash! commits updateRefs = true; # update stacked branches during rebase missingCommitsCheck = "error"; # abort if a commit line is deleted };
init.defaultBranch = "main";
transfer.fsckObjects = true; # integrity check on any transfer receive.fsckObjects = true; # integrity check on push receive
diff = { algorithm = "histogram"; # better rename/move detection than default colorMoved = "plain"; # distinguish moved lines from add/delete mnemonicPrefix = true; # i/ w/ c/ prefixes instead of a/ b/ renames = true; # detect renames wsErrorHighlight = "all"; # highlight whitespace errors in diffs };
log = { date = "human"; # smart relative/absolute dates abbrevCommit = true; # short commit hashes graphColors = "blue,yellow,cyan,magenta,green,red"; };
status = { showStash = true; # show stash count in status submoduleSummary = true; # show submodule change summary };
branch.sort = "-committerdate"; # list branches by most recent commit
tag.sort = "version:refname"; # sort tags as versions, not lexically
column.ui = "auto"; # columnar output where it fits
rerere = { enabled = true; # reuse recorded conflict resolutions autoupdate = true; # auto-stage replayed resolutions };
help.autocorrect = "prompt"; # prompt before running a corrected command
color = { decorate = { HEAD = "red"; branch = "blue"; tag = "yellow"; remoteBranch = "magenta"; }; branch = { current = "magenta"; local = "default"; remote = "yellow"; upstream = "green"; plain = "blue"; }; };
gpg.ssh.allowedSignersFile = toString config.my.git.allowedSignersFile;
# Rewrite ssh to https url = { "https://github.com/".insteadOf = [ "git@github.com:" "ssh://git@github.com/" ]; "https://gitlab.com/".insteadOf = [ "git@gitlab.com:" "ssh://git@gitlab.com/" ]; }; }; }; };}