refactor: move git config to common

This commit is contained in:
matt1432 2023-10-15 16:41:34 -04:00
parent 4430100b9e
commit be74ce41cc
4 changed files with 35 additions and 54 deletions

View file

@ -34,8 +34,9 @@
default = { default = {
imports = [ imports = [
nur.hmModules.nur nur.hmModules.nur
./modules/neovim
./modules/bash ./modules/bash
./modules/git
./modules/neovim
]; ];
home.packages = [ home.packages = [

View file

@ -0,0 +1,18 @@
# Home-manager module
{ pkgs, ... }: {
programs = {
git = {
enable = true;
lfs.enable = true;
userName = "matt1432";
userEmail = "matt@nelim.org";
includes = [
{ path = "${pkgs.dracula-theme}/git-colors"; }
];
};
};
}

View file

@ -8,6 +8,13 @@ final: prev: {
hash = "sha256-7YwkBzkAND9lfH2ewuwna1zUkQStBBx4JHGw3/+svhA="; hash = "sha256-7YwkBzkAND9lfH2ewuwna1zUkQStBBx4JHGw3/+svhA=";
}; };
git-colors = prev.fetchFromGitHub {
owner = "dracula";
repo = "git";
rev = "924d5fc32f7ca15d0dd3a8d2cf1747e81e063c73";
hash = "sha256-3tKjKn5IHIByj+xgi2AIL1vZANlb0vlYJsPjH6BHGxM=";
};
src = prev.fetchFromGitHub { src = prev.fetchFromGitHub {
owner = "dracula"; owner = "dracula";
repo = "gtk"; repo = "gtk";
@ -21,6 +28,13 @@ final: prev: {
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
cp -a ${git-colors}/config/gitconfig ./git-colors
chmod 777 ./git-colors
line=$(grep -n 'Dracula Dark Theme' ./git-colors | cut -d: -f1)
sed -i "1,$((line-1))d" ./git-colors
mkdir -p $out
cp -a ./git-colors $out
cp -a ${plymouth}/dracula ./dracula cp -a ${plymouth}/dracula ./dracula
chmod 777 ./dracula chmod 777 ./dracula
sed -i "s@\/usr\/@$out\/@" ./dracula/dracula.plymouth sed -i "s@\/usr\/@$out\/@" ./dracula/dracula.plymouth
@ -28,6 +42,7 @@ final: prev: {
mkdir -p $out/share/plymouth/themes mkdir -p $out/share/plymouth/themes
cp -a ./dracula $out/share/plymouth/themes/ cp -a ./dracula $out/share/plymouth/themes/
mkdir -p $out/share/themes/Dracula mkdir -p $out/share/themes/Dracula
cp -a {assets,cinnamon,gnome-shell,gtk-2.0,gtk-3.0,gtk-3.20,gtk-4.0,index.theme,metacity-1,unity,xfwm4} $out/share/themes/Dracula cp -a {assets,cinnamon,gnome-shell,gtk-2.0,gtk-3.0,gtk-3.20,gtk-4.0,index.theme,metacity-1,unity,xfwm4} $out/share/themes/Dracula

View file

@ -78,59 +78,6 @@
$HOME/.tmux/plugins/tpm/tpm"' $HOME/.tmux/plugins/tpm/tpm"'
''; '';
}; };
git = { # TODO: make better config
enable = true;
lfs.enable = true;
config = {
# Dracula Dark Theme
color = {
ui = "auto";
branch = {
current = "cyan bold reverse";
local = "white";
plain = "";
remote = "cyan";
};
diff = {
commit = "";
func = "cyan";
plain = "";
whitespace = "magenta reverse";
meta = "white";
frag = "cyan bold reverse";
old = "red";
new = "green";
};
grep = {
context = "";
filename = "";
function = "";
linenumber = "white";
match = "";
selected = "";
separator = "";
};
interactive = {
error = "";
header = "";
help = "";
prompt = "";
};
status = {
added = "green";
changed = "yellow";
header = "";
localBranch = "";
nobranch = "";
remoteBranch = "cyan bold";
unmerged = "magenta bold reverse";
untracked = "red";
updated = "green bold";
};
};
};
};
}; };
# List packages in root user PATH # List packages in root user PATH