made git profile options.

This commit is contained in:
Gabe Venberg 2024-03-24 22:56:01 -05:00
parent a26d6a1e02
commit 90409b441f
8 changed files with 187 additions and 129 deletions

View file

@ -5,12 +5,21 @@
lib, lib,
... ...
}: { }: {
# Home Manager needs a bit of information about you and the paths it should
# manage.
# machine specific options # machine specific options
host.enable-speech = true; host = {
host.nvim.enable-lsp = true; enable-speech = true;
host.nvim.enable-treesitter = true; nvim = {
enable-lsp = true;
enable-treesitter = true;
};
git = {
profile = {
name = "Gabe Venberg";
email = "gabevenberg@gmail.com";
};
workProfile.enable = false;
};
};
home.username = "gabe"; home.username = "gabe";
home.homeDirectory = "/home/gabe"; home.homeDirectory = "/home/gabe";

View file

@ -4,18 +4,27 @@
lib, lib,
... ...
}: { }: {
# Home Manager needs a bit of information about you and the paths it should
# manage.
# machine specific options # machine specific options
host.enable-speech = true; host = {
host.nvim.enable-lsp = true; enable-speech = true;
host.nvim.enable-treesitter = true; nvim = {
enable-lsp = true;
enable-treesitter = true;
};
git = {
profile = {
name = "Gabe Venberg";
email = "gabevenberg@gmail.com";
};
workProfile.enable = false;
};
};
targets.genericLinux.enable = true; targets.genericLinux.enable = true;
home.username = "gabe"; home.username = "gabe";
home.homeDirectory = "/home/gabe"; home.homeDirectory = "/home/gabe";
imports = [ imports = [
../terminal/terminal.nix ../modules/home-manager/terminal/terminal.nix
../../modules/home-manager/home-manager.nix ../modules/home-manager/home-manager.nix
]; ];
} }

View file

@ -0,0 +1,33 @@
{
config,
pkgs,
lib,
...
}: {
host = {
# machine specific options
enable-speech = true;
nvim = {
enable-lsp = true;
enable-treesitter = true;
};
git = {
profile = {
name = "Gabe Venberg";
email = "gabevenberg@gmail.com";
};
workProfile = {
enable = true;
email = "venberggabe@johndeere.com";
};
};
};
targets.genericLinux.enable = true;
home.username = "gabe";
home.homeDirectory = "/home/gabe";
imports = [
../modules/home-manager/terminal/terminal.nix
../modules/home-manager/home-manager.nix
];
}

View file

@ -1,21 +0,0 @@
{
config,
pkgs,
lib,
...
}: {
# Home Manager needs a bit of information about you and the paths it should
# manage.
# machine specific options
host.enable-speech = false;
host.nvim.enable-lsp = false;
host.nvim.enable-treesitter = true;
targets.genericLinux.enable = true;
home.username = "gabe";
home.homeDirectory = "/home/gabe";
imports = [
../terminal/terminal.nix
../../modules/home-manager/home-manager.nix
];
}

View file

@ -1,57 +1,79 @@
{ {
config, config,
pgks, pgks,
lib,
... ...
}: { }: {
programs.git = { options = {
enable = true; host.git.workProfile = {
aliases = { enable = lib.mkEnableOption "git work profile";
hist = "log --graph --date-order --date=short --pretty=format:'%C(auto)%h%d %C(reset)%s %C(bold blue)%ce %C(reset)%C(green)%cr (%cd)'"; email = lib.mkOption {
graph = "log --graph --topo-order --all --pretty=format:'%C(auto)%h %C(cyan)%an %C(blue)%ar %C(auto)%d %s'"; type = lib.types.str;
recent = "branch --sort=-committerdate --format='%(committerdate:relative)%09%(refname:short)'"; description = "email for work profile.";
}; };
delta.enable = true; };
# difftastic.enable=true; host.git.profile = {
# difftastic.background="dark"; email = lib.mkOption {
userEmail = "gabevenberg@gmail.com"; type = lib.types.str;
userName = "Gabe Venberg"; description = "email for main profile";
extraConfig = { };
init = { name = lib.mkOption {
defaultBranch = "main"; type = lib.types.str;
}; description = "name for main profile";
push = {
autoSetupRemote = true;
default = "current";
};
pull = {
ff = true;
};
merge = {
conflictstyle = "zdiff3";
};
rebase = {
autosquash = true;
};
help = {
autocorrect = "prompt";
};
branch = {
sort = "-committerdate";
};
status = {
submodulesummary = true;
}; };
}; };
includes = [
{
condition = "gitdir:~/work/";
contents = {
user = {
email = "venberggabe@johndeere.com";
};
};
}
];
}; };
programs.lazygit.enable = true;
config = {
programs.git = {
enable = true;
aliases = {
hist = "log --graph --date-order --date=short --pretty=format:'%C(auto)%h%d %C(reset)%s %C(bold blue)%ce %C(reset)%C(green)%cr (%cd)'";
graph = "log --graph --topo-order --all --pretty=format:'%C(auto)%h %C(cyan)%an %C(blue)%ar %C(auto)%d %s'";
recent = "branch --sort=-committerdate --format='%(committerdate:relative)%09%(refname:short)'";
};
delta.enable = true;
# difftastic.enable=true;
# difftastic.background="dark";
userEmail = config.host.git.profile.email;
userName = config.host.git.profile.name;
extraConfig = {
init = {
defaultBranch = "main";
};
push = {
autoSetupRemote = true;
default = "current";
};
pull = {
ff = true;
};
merge = {
conflictstyle = "zdiff3";
};
rebase = {
autosquash = true;
};
help = {
autocorrect = "prompt";
};
branch = {
sort = "-committerdate";
};
status = {
submodulesummary = true;
};
};
includes =
if config.host.git.workProfile.enable
then [
{
condition = "gitdir:~/work/";
contents.user.email = config.host.git.workProfile.email;
}
]
else [];
};
programs.lazygit.enable = true;
};
} }

View file

@ -0,0 +1,49 @@
{
config,
pkgs,
lib,
...
}: {
home.file = {
".clangd".text = ''
# keeps clangd from choking when it sees a compiler flag for a different
# compiler. (sutch as when acting as an lsp for a project that uses GCC.)
CompileFlags:
Add: -Wno-unknown-warning-option
Remove: [-m*, -f*]
'';
".clang-format".text = ''
---
#this syncronizes with settings used by neovims treesitters so that the lsp formatting and treesitter formatting do not fight eatch other.
PointerAlignment: Left
ColumnLimit: 80
IndentWidth: 4
TabWidth: 4
UseCRLF: false
UseTab: Never
AlignAfterOpenBracket: BlockIndent
AlwaysBreakBeforeMultilineStrings: true
BreakBeforeBraces: Attach
AlignOperands: Align
BreakBeforeBinaryOperators: NonAssignment
...
'';
"work/.clang-format" = lib.mkIf config.host.git.workProfile.enable{
text = ''
---
#this syncronizes with settings used by neovims treesitters so that the lsp formatting and treesitter formatting do not fight eatch other.
PointerAlignment: Left
ColumnLimit: 80
IndentWidth: 4
TabWidth: 4
UseCRLF: false
UseTab: Never
AlignAfterOpenBracket: BlockIndent
AlwaysBreakBeforeMultilineStrings: true
BreakBeforeBraces: Allman
BreakBeforeBinaryOperators: None
...
'';
};
};
}

View file

@ -197,49 +197,12 @@
} }
]; ];
}; };
home.file = {
".clangd".text = ''
# keeps clangd from choking when it sees a compiler flag for a different
# compiler. (sutch as when acting as an lsp for a project that uses GCC.)
CompileFlags:
Add: -Wno-unknown-warning-option
Remove: [-m*, -f*]
'';
".clang-format".text = ''
---
#this syncronizes with settings used by neovims treesitters so that the lsp formatting and treesitter formatting do not fight eatch other.
PointerAlignment: Left
ColumnLimit: 80
IndentWidth: 4
TabWidth: 4
UseCRLF: false
UseTab: Never
AlignAfterOpenBracket: BlockIndent
AlwaysBreakBeforeMultilineStrings: true
BreakBeforeBraces: Attach
AlignOperands: Align
BreakBeforeBinaryOperators: NonAssignment
...
'';
"work/.clang-format".text = ''
---
#this syncronizes with settings used by neovims treesitters so that the lsp formatting and treesitter formatting do not fight eatch other.
PointerAlignment: Left
ColumnLimit: 80
IndentWidth: 4
TabWidth: 4
UseCRLF: false
UseTab: Never
AlignAfterOpenBracket: BlockIndent
AlwaysBreakBeforeMultilineStrings: true
BreakBeforeBraces: Allman
BreakBeforeBinaryOperators: None
...
'';
};
home.packages = with pkgs; [ home.packages = with pkgs; [
alejandra alejandra
]; ];
}; };
imports = [./rust-tools.nix]; imports = [
./rust-tools.nix
./clangd.nix
];
} }

View file

@ -5,13 +5,7 @@
... ...
}: { }: {
options = { options = {
host.enable-speech = lib.mkOption { host.enable-speech = lib.mkEnableOption "espeak";
default = false;
type = lib.types.bool;
description = ''
install a text to speech engine
'';
};
}; };
config = config =