# In deiner home.nix { config, pkgs, ... }: { programs.git = { enable = true; settings = { aliases = { # Because I constantly forget how to do this # https://git-scm.com/docs/git-fetch#git-fetch--p prune = "fetch --prune"; # Not quite as common as an amend, but still common # https://git-scm.com/docs/git-reset#git-reset-emgitresetemltmodegtltcommitgt undo = "reset --soft HEAD^"; # We wanna grab those pesky un-added files! # https://git-scm.com/docs/git-stash stash-all = "stash save --include-untracked"; # No need for a GUI - a nice, colorful, graphical representation # https://git-scm.com/docs/git-log # via https://medium.com/@payload.dd/thanks-for-the-git-st-i-will-use-this-4da5839a21a4 graph = "log --graph --decorate --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'"; }; apply.whitespace = "fix"; branch = { autosetuprebase = "remote"; sort = "-authordate"; }; "branch \"main\"" = { remote = "origin"; merge = "refs/heads/main"; rebase = true; }; color = { ui = "auto"; branch = "auto"; diff = "auto"; status = "auto"; interactive = "auto"; pager = true; }; "color \"branch\"" = { current = "yellow reverse"; local = "yellow"; remote = "green"; }; "color \"diff\"" = { meta = "yellow bold"; frag = "magenta bold"; old = "red bold"; new = "green bold"; whitespace = "red reverse"; }; "color \"diff-highlight\"" = { oldNormal = "red bold"; oldHighlight = "red bold 52"; newNormal = "green bold"; newHighlight = "green bold 22"; }; "color \"status\"" = { added = "yellow"; changed = "green"; untracked = "cyan"; }; core = { pager = "less -FRSX"; whitespace = "fix,-indent-with-non-tab,trailing-space,cr-at-eol"; editor = "vim"; fileMode = false; autocrlf = "input"; }; credential.helper = "cache"; diff.tool = "vimdiff"; difftool.prompt = false; fetch.prune = true; http.sslverify = false; include.path = "~/.gitconfig_override"; init.defaultBranch = "main"; merge.tool = "vimdiff"; mergetool.prompt = false; pull.rebase = false; push = { # "push the current branch back to the branch whose changes are usually integrated into the current branch" # "refuse to push if the upstream branch’s name is different from the local one" # https://git-scm.com/docs/git-config#git-config-pushdefault default = "simple"; # Because I get sick of telling git to do it manually # https://git-scm.com/docs/git-config#git-config-pushfollowTags followTags = true; }; rerere.enabled = 1; # Sometimes a newly-added folder, since it's only one line in git status, can slip under the radar. # https://git-scm.com/docs/git-config#git-config-statusshowUntrackedFiles status.showUntrackedFiles = "all"; }; ignores = [ ".idea" # JetBrains IDEs ]; }; programs.vim = { enable = true; defaultEditor = true; settings = { number = true; relativenumber = true; tabstop = 2; shiftwidth = 2; expandtab = true; }; extraConfig = '' syntax on set encoding=utf-8 set autoindent set smartindent ''; }; programs.zsh = { enable = true; enableCompletion = true; autosuggestion.enable = true; syntaxHighlighting.enable = true; oh-my-zsh = { enable = true; theme = "powerlevel10k/powerlevel10k"; plugins = [ "command-not-found" "common-aliases" "docker" "docker-compose" "git" "git-prompt" "git-flow-avh" "ssh-agent" "systemd" "sudo" "rsync" ]; custom = "$HOME/.oh-my-zsh/custom"; }; initContent = '' # Bell deaktivieren unsetopt BEEP # Powerlevel10k Konfiguration laden (falls vorhanden) [[ -f ~/.p10k.zsh ]] && source ~/.p10k.zsh ''; }; }