mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 00:38:12 +09:00
feat
This commit is contained in:
@@ -10,13 +10,28 @@ in
|
||||
{
|
||||
options.my.applications.git.homeManager = {
|
||||
enable = lib.mkEnableOption "git home-manager configuration";
|
||||
|
||||
signingKey = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = "~/.ssh/id_ed25519_sk_rk.pub";
|
||||
example = "~/.ssh/id_ed25519.pub";
|
||||
description = "SSH public key path used for Git commit and tag signing.";
|
||||
};
|
||||
};
|
||||
|
||||
config.home-manager.sharedModules = [
|
||||
{
|
||||
config = lib.mkIf hmCfg.enable {
|
||||
config = lib.mkIf hmCfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = hmCfg.signingKey != null;
|
||||
message = "my.applications.git.homeManager.signingKey must be set per host.";
|
||||
}
|
||||
];
|
||||
|
||||
home-manager.sharedModules = [
|
||||
{
|
||||
programs.git = {
|
||||
enable = true;
|
||||
|
||||
ignores = [
|
||||
".direnv/"
|
||||
".envrc"
|
||||
@@ -24,12 +39,15 @@ in
|
||||
];
|
||||
|
||||
signing = {
|
||||
key = hmCfg.signingKey;
|
||||
format = "ssh";
|
||||
signByDefault = true;
|
||||
};
|
||||
|
||||
settings = {
|
||||
user.name = cfg.userName;
|
||||
user.email = cfg.userEmail;
|
||||
|
||||
push.default = "simple";
|
||||
credential.helper = "cache --timeout=7200";
|
||||
init.defaultBranch = "main";
|
||||
@@ -37,16 +55,6 @@ in
|
||||
log.date = "iso";
|
||||
merge.conflictStyle = "diff3";
|
||||
|
||||
tag.gpgSign = true;
|
||||
|
||||
gpg = {
|
||||
format = "ssh";
|
||||
|
||||
ssh = {
|
||||
defaultKeyCommand = "ssh-add -L";
|
||||
};
|
||||
};
|
||||
|
||||
alias = {
|
||||
br = "branch --sort=-committerdate";
|
||||
co = "checkout";
|
||||
@@ -59,7 +67,7 @@ in
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user