feat: move git to module

This commit is contained in:
Yadunand Prem 2024-04-16 12:39:20 +08:00
parent 1b546b236b
commit dc4f1537d8
No known key found for this signature in database
4 changed files with 57 additions and 19 deletions

View File

@ -17,7 +17,7 @@
# Specify your home configuration modules here, for example,
# the path to your home.nix.
modules = [ ./yadunut-mbp/home.nix ./modules/zsh.nix ./modules/neovim.nix ];
modules = [ ./yadunut-mbp/home.nix ./modules/zsh.nix ./modules/neovim.nix ./modules/git.nix ];
# Optionally use extraSpecialArgs
# to pass through arguments to home.nix

27
modules/git.nix Normal file
View File

@ -0,0 +1,27 @@
{
programs.git = {
enable = true;
userEmail = "yadunand@yadunut.com";
userName = "Yadunand Prem";
delta.enable = true;
lfs.enable = true;
extraConfig = {
init.defautBranch = "main";
pull.rebase = true;
pull.autostash = true;
rebase.autostash = true;
core.excludefile = "~/.gitignore_global";
push.autoSetupRemote = true;
commit.gpgsign = true;
commit.verbose = true;
gpg.format = "ssh";
};
};
}

View File

@ -3,6 +3,11 @@
home.packages = [
pkgs.zsh-completions
pkgs.bat
pkgs.fd
pkgs.htop
pkgs.ripgrep
pkgs.wget
];
programs.zsh = {
enable = true;
@ -24,13 +29,20 @@
];
};
shellAliases = {
lg = "lazygit";
cat = "bat";
diff = "delta";
s = "kitty +kitten ssh";
};
};
programs.fzf.enable = true;
programs.fzf.enableZshIntegration = true;
programs.zoxide.enable = true;
programs.zoxide.enableZshIntegration = true;
programs.eza.enable = true;
programs.eza.enableZshIntegration = true;
programs.starship = {
enable = true;
enableZshIntegration = true;

View File

@ -18,18 +18,14 @@
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = [
pkgs.bat
pkgs.beancount
pkgs.coq
pkgs.delta
# pkgs.dive
pkgs.entr
pkgs.fava
pkgs.fd
pkgs.htop
pkgs.ripgrep
pkgs.typst
pkgs.wget
pkgs.lazygit
# Neovim deps
# pkgs.texlab
@ -64,6 +60,11 @@
EDITOR = "nvim";
};
programs.zsh.shellAliases = {
lg = "lazygit";
s = "kitty +kitten ssh";
};
programs.direnv = {
enable = true;
enableZshIntegration = true;
@ -73,22 +74,20 @@
};
};
programs.fzf.enable = true;
programs.fzf.enableZshIntegration = true;
programs.zoxide.enable = true;
programs.zoxide.enableZshIntegration = true;
programs.eza.enable = true;
programs.eza.enableZshIntegration = true;
programs.kitty.shellIntegration.enableZshIntegration = true;
programs.emacs.enable = true;
programs.lazygit.enable = true;
programs.neovim.enable = true;
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
programs.git.extraConfig = {
gpg.ssh.program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign";
user.signingkey = "~/.ssh/yadunut_ed25519.pub";
};
programs.gh = {
enable = true;
};
}