more work
This commit is contained in:
parent
423e99886d
commit
a03240d99d
36 changed files with 843 additions and 842 deletions
111
modules/home/shell/toolset/git.nix
Normal file
111
modules/home/shell/toolset/git.nix
Normal file
|
@ -0,0 +1,111 @@
|
|||
{ config, lib, pkgs, user, ... }:
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf;
|
||||
|
||||
cfg = config.${namespace}.shell.toolset.git;
|
||||
in
|
||||
{
|
||||
options.${namespace}.shell.toolset.git = {
|
||||
enable = mkEnableOption "version-control system";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.sessionVariables.GITHUB_TOKEN = "$(cat /run/agenix/tokenGH)";
|
||||
|
||||
home.packages = with pkgs; [ lazygit lazyjj jujutsu ];
|
||||
|
||||
programs = {
|
||||
zsh.initContent = ''
|
||||
# -------===[ Helpful Git Fn's ]===------- #
|
||||
gitignore() {
|
||||
curl -s -o .gitignore https://gitignore.io/api/$1
|
||||
}
|
||||
'';
|
||||
|
||||
fish.functions = {
|
||||
gitignore = "curl -sL https://www.gitignore.io/api/$argv";
|
||||
};
|
||||
|
||||
git = {
|
||||
enable = true;
|
||||
package = pkgs.gitFull;
|
||||
difftastic = {
|
||||
enable = true;
|
||||
background = "dark";
|
||||
color = "always";
|
||||
display = "inline";
|
||||
};
|
||||
|
||||
ignores = [
|
||||
# General:
|
||||
"*.bloop"
|
||||
"*.bsp"
|
||||
"*.metals"
|
||||
"*.metals.sbt"
|
||||
"*metals.sbt"
|
||||
"*.direnv"
|
||||
"*.envrc"
|
||||
"*hie.yaml"
|
||||
"*.mill-version"
|
||||
"*.jvmopts"
|
||||
|
||||
# OS-related:
|
||||
".DS_Store?"
|
||||
".DS_Store"
|
||||
".CFUserTextEncoding"
|
||||
".Trash"
|
||||
".Xauthority"
|
||||
"thumbs.db"
|
||||
"Thumbs.db"
|
||||
"Icon?"
|
||||
|
||||
# Compiled residues:
|
||||
"*.class"
|
||||
"*.exe"
|
||||
"*.o"
|
||||
"*.pyc"
|
||||
"*.elc"
|
||||
];
|
||||
|
||||
extraConfig = {
|
||||
init.defaultBranch = "main";
|
||||
core = {
|
||||
editor = "nvim";
|
||||
whitespace = "trailing-space,space-before-tab";
|
||||
};
|
||||
credential.helper = "${pkgs.gitFull}/bin/git-credential-libsecret";
|
||||
|
||||
user = {
|
||||
name = config.${namespace}.user.full_name;
|
||||
email = config.${namespace}.user.email;
|
||||
signingKey = "~/.ssh/id_rsa.pub";
|
||||
};
|
||||
|
||||
gpg.format = "ssh";
|
||||
commit.gpgSign = true;
|
||||
tag.gpgSign = true;
|
||||
|
||||
push = {
|
||||
autoSetupRemote = true;
|
||||
default = "current";
|
||||
gpgSign = "if-asked";
|
||||
autoSquash = true;
|
||||
};
|
||||
pull.rebase = true;
|
||||
|
||||
filter = {
|
||||
required = true;
|
||||
smudge = "git-lfs smudge -- %f";
|
||||
process = "git-lfs filter-process";
|
||||
clean = "git-lfs clean -- %f";
|
||||
};
|
||||
|
||||
url = {
|
||||
"https://github.com/".insteadOf = "gh:";
|
||||
"git@github.com:".insteadOf = "ssh+gh:";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue