refactor: switch from modules to import arrays

This commit is contained in:
wi11-holdsworth 2025-10-22 01:22:05 +11:00
parent d893750c09
commit 41eaa38d31
75 changed files with 1870 additions and 2541 deletions

View file

@ -1,56 +1,44 @@
{
config,
lib,
...
}:
let
feature = "git";
in
{
config = lib.mkIf config.${feature}.enable {
programs.${feature} = {
programs.git = {
enable = true;
delta = {
enable = true;
options.theme = "Dracula";
};
delta = {
enable = true;
options.theme = "Dracula";
};
userName = "wi11-holdsworth";
userEmail = "83637728+wi11-holdsworth@users.noreply.github.com";
userName = "wi11-holdsworth";
userEmail = "83637728+wi11-holdsworth@users.noreply.github.com";
aliases = {
# keep-sorted start
a = "add";
aa = "add .";
ap = "add -p";
c = "commit --verbose";
ca = "commit -a --verbose";
cam = "commit -a -m";
cm = "commit -m";
co = "checkout";
cob = "checkout -b";
d = "diff";
dc = "diff --cached";
ds = "diff --stat";
m = "commit --amend --verbose";
pl = "pull";
ps = "push";
s = "status -s";
# keep-sorted end
};
aliases = {
# keep-sorted start
a = "add";
aa = "add .";
ap = "add -p";
c = "commit --verbose";
ca = "commit -a --verbose";
cam = "commit -a -m";
cm = "commit -m";
co = "checkout";
cob = "checkout -b";
d = "diff";
dc = "diff --cached";
ds = "diff --stat";
m = "commit --amend --verbose";
pl = "pull";
ps = "push";
s = "status -s";
# keep-sorted end
};
extraConfig = {
init.defaultBranch = "main";
extraConfig = {
init.defaultBranch = "main";
core.editor = "nvim";
core.editor = "nvim";
push.autoSetupRemote = true;
push.autoSetupRemote = true;
pull.rebase = false;
};
pull.rebase = false;
};
};
options.${feature}.enable = lib.mkEnableOption "enables ${feature}";
}