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

View file

@ -4,18 +4,27 @@
lib,
...
}: {
# Home Manager needs a bit of information about you and the paths it should
# manage.
# machine specific options
host.enable-speech = true;
host.nvim.enable-lsp = true;
host.nvim.enable-treesitter = true;
host = {
enable-speech = true;
nvim = {
enable-lsp = true;
enable-treesitter = true;
};
git = {
profile = {
name = "Gabe Venberg";
email = "gabevenberg@gmail.com";
};
workProfile.enable = false;
};
};
targets.genericLinux.enable = true;
home.username = "gabe";
home.homeDirectory = "/home/gabe";
imports = [
../terminal/terminal.nix
../../modules/home-manager/home-manager.nix
../modules/home-manager/terminal/terminal.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,8 +1,30 @@
{
config,
pgks,
lib,
...
}: {
options = {
host.git.workProfile = {
enable = lib.mkEnableOption "git work profile";
email = lib.mkOption {
type = lib.types.str;
description = "email for work profile.";
};
};
host.git.profile = {
email = lib.mkOption {
type = lib.types.str;
description = "email for main profile";
};
name = lib.mkOption {
type = lib.types.str;
description = "name for main profile";
};
};
};
config = {
programs.git = {
enable = true;
aliases = {
@ -13,8 +35,8 @@
delta.enable = true;
# difftastic.enable=true;
# difftastic.background="dark";
userEmail = "gabevenberg@gmail.com";
userName = "Gabe Venberg";
userEmail = config.host.git.profile.email;
userName = config.host.git.profile.name;
extraConfig = {
init = {
defaultBranch = "main";
@ -42,16 +64,16 @@
submodulesummary = true;
};
};
includes = [
includes =
if config.host.git.workProfile.enable
then [
{
condition = "gitdir:~/work/";
contents = {
user = {
email = "venberggabe@johndeere.com";
};
};
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; [
alejandra
];
};
imports = [./rust-tools.nix];
imports = [
./rust-tools.nix
./clangd.nix
];
}

View file

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