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,8 +1,30 @@
{ {
config, config,
pgks, 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 = { programs.git = {
enable = true; enable = true;
aliases = { aliases = {
@ -13,8 +35,8 @@
delta.enable = true; delta.enable = true;
# difftastic.enable=true; # difftastic.enable=true;
# difftastic.background="dark"; # difftastic.background="dark";
userEmail = "gabevenberg@gmail.com"; userEmail = config.host.git.profile.email;
userName = "Gabe Venberg"; userName = config.host.git.profile.name;
extraConfig = { extraConfig = {
init = { init = {
defaultBranch = "main"; defaultBranch = "main";
@ -42,16 +64,16 @@
submodulesummary = true; submodulesummary = true;
}; };
}; };
includes = [ includes =
if config.host.git.workProfile.enable
then [
{ {
condition = "gitdir:~/work/"; condition = "gitdir:~/work/";
contents = { contents.user.email = config.host.git.workProfile.email;
user = {
email = "venberggabe@johndeere.com";
};
};
} }
]; ]
else [];
}; };
programs.lazygit.enable = true; 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 =