49 current 2024-02-29 22:45:25 24.05.20240228.9099616 6.6.18 *

This commit is contained in:
zackartz 2024-02-29 22:45:28 -05:00
parent 548ffbb3b3
commit 867fe1c21e
4 changed files with 186 additions and 1 deletions

View file

@ -16,7 +16,7 @@
while inotifywait -e close_write $1; do pandoc $@; done
'';
in {
imports = [./zsh/default.nix];
imports = [./zsh ./zsh/tools.nix ./git.nix ./starship.nix];
home.packages = with pkgs; [
texlive

73
modules/shell/git.nix Normal file
View file

@ -0,0 +1,73 @@
{pkgs, ...}: {
home.packages = with pkgs; [zsh-forgit gitflow];
programs.git = {
enable = true;
userName = "zack";
userEmail = "zackmyers@lavabit.com";
signing = {
key = "056CFD15A9F99B0E";
signByDefault = false;
};
ignores = [
".cache/"
".DS_Store"
".idea/"
"*.swp"
"*.elc"
"auto-save-list"
".direnv/"
"node_modules"
"result"
"result-*"
];
extraConfig = {
init = {defaultBranch = "main";};
delta = {
options.map-styles = "bold purple => syntax #ca9ee6, bold cyan => syntax #8caaee";
line-numbers = true;
};
branch.autosetupmerge = "true";
push.default = "current";
merge.stat = "true";
core.whitespace = "fix,-indent-with-non-tab,trailing-space,cr-at-eol";
repack.usedeltabaseoffset = "true";
pull.ff = "only";
rebase = {
autoSquash = true;
autoStash = true;
};
rerere = {
autoupdate = true;
enabled = true;
};
};
lfs.enable = true;
delta.enable = true;
aliases = {
essa = "push --force";
co = "checkout";
fuck = "commit --amend -m";
c = "commit -m";
ca = "commit -am";
forgor = "commit --amend --no-edit";
graph = "log --all --decorate --graph --oneline";
oops = "checkout --";
l = "log";
r = "rebase";
s = "status --short";
ss = "status";
d = "diff";
ps = "!git push origin $(git rev-parse --abbrev-ref HEAD)";
pl = "!git pull origin $(git rev-parse --abbrev-ref HEAD)";
af = "!git add $(git ls-files -m -o --exclude-standard | sk -m)";
st = "status";
br = "branch";
df = "!git hist | peco | awk '{print $2}' | xargs -I {} git diff {}^ {}";
hist = ''
log --pretty=format:"%Cgreen%h %Creset%cd %Cblue[%cn] %Creset%s%C(yellow)%d%C(reset)" --graph --date=relative --decorate --all'';
llog = ''
log --graph --name-status --pretty=format:"%C(red)%h %C(reset)(%cd) %C(green)%an %Creset%s %C(yellow)%d%Creset" --date=relative'';
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; hx `f`";
};
};
}

View file

@ -0,0 +1,26 @@
{config, ...}: {
programs.starship = {
enable = true;
enableZshIntegration = config.programs.zsh.enable;
settings = {
add_newline = false;
command_timeout = 1000;
scan_timeout = 3;
character = {
error_symbol = "[󰊠](bold red)";
success_symbol = "[󰊠](bold green)";
vicmd_symbol = "[󰊠](bold yellow)";
format = "$symbol [|](bold bright-black) ";
};
git_commit = {commit_hash_length = 7;};
line_break.disabled = false;
lua.symbol = "[](blue) ";
python.symbol = "[](blue) ";
hostname = {
ssh_only = true;
format = "[$hostname](bold blue) ";
disabled = false;
};
};
};
}