feat: ssh signing

Signed-off-by: jolheiser <john.olheiser@gmail.com>
homepage
jolheiser 2024-07-10 10:48:54 -05:00 committed by jolheiser
parent 2b9b540574
commit f66a3fe2f3
No known key found for this signature in database
2 changed files with 42 additions and 38 deletions

View File

@ -1,18 +1,26 @@
{config, ...}: let {
key = "0xB853ADA5DA7BBF7A"; pkgs,
config,
...
}: let
insteadOf = prefix: domain: { insteadOf = prefix: domain: {
"https://${domain}/".insteadOf = "${prefix}:"; "https://${domain}/".insteadOf = "${prefix}:";
"git@${domain}:".insteadOf = "ssh:${prefix}:"; "git@${domain}:".insteadOf = "ssh:${prefix}:";
}; };
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAUxLwkJOlalAHTdkbh+m49XTZGKDqWz1o/o8OLmtQdX";
sshSigning = {
commit.gpgsign = true;
user.signingkey = key;
gpg = {
format = "ssh";
ssh.allowedSignersFile = "${pkgs.writeText "allowedSigners" "git@jolheiser.com ${key}"}";
};
};
in { in {
programs.git = { programs.git = {
enable = true; enable = true;
userName = "jolheiser"; userName = "jolheiser";
userEmail = "john.olheiser@gmail.com"; userEmail = "git@jolheiser.com";
signing = {
signByDefault = true;
key = key;
};
aliases = { aliases = {
wt = "worktree"; wt = "worktree";
ci = "commit -s -S -m"; ci = "commit -s -S -m";
@ -30,7 +38,9 @@ in {
}; };
lfs.enable = true; lfs.enable = true;
ignores = [".idea/" "result" "node_modules" "ve"]; ignores = [".idea/" "result" "node_modules" "ve"];
extraConfig = { extraConfig =
{
commit.gpgsign = true;
init.defaultBranch = "main"; init.defaultBranch = "main";
merge.conflictstyle = "zdiff3"; merge.conflictstyle = "zdiff3";
diff.colorMoved = "default"; diff.colorMoved = "default";
@ -51,16 +61,10 @@ in {
// insteadOf "gt" "gitea.com" // insteadOf "gt" "gitea.com"
// insteadOf "gl" "gitlab.com" // insteadOf "gl" "gitlab.com"
// insteadOf "cb" "codeberg.org"; // insteadOf "cb" "codeberg.org";
}; }
delta = { // sshSigning;
difftastic = {
enable = true; enable = true;
options = {
features = "ctp-mocha";
navigate = true;
light = false;
line-numbers = true;
side-by-side = true;
};
}; };
includes = [ includes = [
{ {

View File

@ -4,7 +4,7 @@
settings = { settings = {
user = { user = {
name = "jolheiser"; name = "jolheiser";
email = "john@jolheiser.com"; email = "git@jolheiser.com";
}; };
ui = { ui = {
diff.tool = ["${pkgs.difftastic}/bin/difft" "--color=always" "$left" "$right"]; diff.tool = ["${pkgs.difftastic}/bin/difft" "--color=always" "$left" "$right"];