added gitconfig

This commit is contained in:
Ariel Sosnovsky committed 2024-04-25 15:58:56 -04:00
1 parent 74e0af7dc6
commit d026be1709
4 files changed
+56 -10

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
# http://editorconfig.org
root = true
[*]
indent_style = tab
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
BIN
View File
Binary file not shown.
+29
View File
@@ -0,0 +1,29 @@
[alias]
pp = "!f() { \
echo 'git pull --ff';\
git pull --ff; \
echo 'git push';\
git push; \
}; f";
up = "pull --rebase --autostash";
ca = "commit -a";
ls = "log --oneline";
cap = "!f() { \
echo 'commiting code'; \
git ca ${@}; \
echo 'pushing...'; \
git push ; \
}; f";
undo-commit = "!f() { \
lastcommit=$(git log --oneline -n 1); \
echo '[[switching]] from' $lastcommit; \
git reset --soft HEAD~${1:-1}; \
lastcommit=$(git log --oneline -n 1); \
echo '[[switching]] to' $lastcommit; \
git status; \
}; f";
sync = "!f() { \
target_branch=${1:-main}; \
remote=${2:-origin}; \
git fetch $remote $target_branch:$target_branch; \
}; f";
+17 -10
View File
@@ -1,6 +1,10 @@
{ hostName, homeMangerVersion, user }: { hostName, homeMangerVersion, user }:
{ pkgs, ... }: { pkgs, ... }:
{ let
gitconfigs =
(builtins.filterSource (path: type: type != "directory") ../../gitconfigs);
gitconfigFiles = builtins.attrNames (builtins.readDir gitconfigs);
in {
home-manager.users.root = { home-manager.users.root = {
home.stateVersion = homeMangerVersion; home.stateVersion = homeMangerVersion;
programs.git = { programs.git = {
@@ -17,9 +21,7 @@
home-manager.users.${user.name} = { home-manager.users.${user.name} = {
home = { home = {
stateVersion = homeMangerVersion; stateVersion = homeMangerVersion;
shellAliases = { shellAliases = { cat = "bat"; };
cat = "bat";
};
packages = [ packages = [
(pkgs.nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" ]; }) (pkgs.nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" ]; })
pkgs.kubectl pkgs.kubectl
@@ -41,9 +43,17 @@
enable = true; enable = true;
userName = user.fullName; userName = user.fullName;
userEmail = user.email; userEmail = user.email;
delta = { delta = { enable = true; };
enable = true; extraConfig = {
color = { ui = "auto"; };
push = {
default = "upstream";
autoSetupRemote = true;
};
init = { defaultBranch = "main"; };
}; };
includes =
(builtins.map (f: { path = gitconfigs + "/" + f; }) gitconfigFiles);
}; };
zsh = { zsh = {
enable = true; enable = true;
@@ -54,10 +64,7 @@
}; };
zsh.oh-my-zsh = { zsh.oh-my-zsh = {
enable = true; enable = true;
plugins = [ plugins = [ "git" "sudo" ];
"git"
"sudo"
];
theme = "robbyrussell"; theme = "robbyrussell";
}; };
}; };