1
Fork 0
satellite/home/features/cli/git.nix

85 lines
2 KiB
Nix
Raw Normal View History

2024-09-11 15:59:50 +02:00
{ config, pkgs, ... }:
{
2024-03-05 00:03:41 +01:00
home.packages = [ pkgs.josh ]; # Just One Single History
2023-12-10 23:48:46 +01:00
# TODO: use `delta` as a pager, as highlighted here
# https://github.com/lilyinstarlight/foosteros/blob/main/config/base.nix#L163
2023-01-10 02:38:06 +01:00
programs.git = {
enable = true;
package = pkgs.gitFull;
userName = "prescientmoon";
2024-02-13 00:02:19 +01:00
userEmail = "git@moonythm.dev";
2023-01-10 02:38:06 +01:00
2023-12-10 23:48:46 +01:00
# {{{ Globally ignored files
2023-07-07 21:25:05 +02:00
ignores = [
# Syncthing
".stfolder"
".stversions"
2023-09-22 18:37:24 +02:00
# Direnv
".direnv"
2023-09-22 18:37:24 +02:00
".envrc"
2023-09-22 20:08:11 +02:00
# Haskell
# NOTE: THIS IS A BAD IDEA
# I need to figure out a better way (this is simply here because
# a project I contribute to doesn't gitignore this file, nor does
# it have it commited).
"hie.yaml"
2023-07-07 21:25:05 +02:00
];
2023-12-10 23:48:46 +01:00
# }}}
2024-09-11 15:59:50 +02:00
# {{{ Aliases
2023-09-22 18:37:24 +02:00
aliases = {
# Print history nicely
graph = "log --decorate --oneline --graph";
# Print last commit's hash
hash = "log -1 --format='%H'";
2024-02-09 20:18:48 +01:00
# Count the number of commits
count = "rev-list --count --all";
2023-09-22 18:37:24 +02:00
};
2023-12-10 23:48:46 +01:00
# }}}
2023-09-22 18:37:24 +02:00
2023-01-10 02:38:06 +01:00
extraConfig = {
2024-05-28 02:39:42 +02:00
github.user = "prescientmoon";
2023-01-10 02:38:06 +01:00
hub.protocol = "ssh";
core.editor = "nvim";
2023-03-31 19:45:20 +02:00
init.defaultBranch = "main";
2023-09-22 18:37:24 +02:00
rebase.autoStash = true;
push.default = "current";
push.autoSetupRemote = true;
# {{{ URL rewriting
url."git@github.com:".insteadOf = [
# Normalize GitHub URLs to SSH to avoid authentication issues with HTTPS.
"https://github.com/"
# Allows typing `git clone github:owner/repo`.
"github:"
];
# }}}
2023-12-10 23:48:46 +01:00
# {{{ Signing
# Sign commits using ssh
gpg.format = "ssh";
user.signingkey = "~/.ssh/id_ed25519.pub";
# Sign everything by default
commit.gpgsign = true;
tag.gpgsign = true;
2023-12-10 23:48:46 +01:00
# }}}
2023-01-10 02:38:06 +01:00
};
};
2023-12-10 23:48:46 +01:00
# {{{ Github cli
programs.gh = {
enable = true;
settings.git_protocol = "ssh";
};
2024-09-11 15:59:50 +02:00
satellite.persistence.at.state.apps.gh.files = [ "${config.xdg.configHome}/gh/hosts.yml" ];
2023-12-10 23:48:46 +01:00
# }}}
2023-01-10 02:38:06 +01:00
}