1password: sign git commits

This commit is contained in:
Sridhar Ratnakumar 2024-06-02 10:34:14 -04:00
parent 4c58b562d7
commit 63ed8d6d42
No known key found for this signature in database

View file

@ -1,4 +1,7 @@
{ pkgs, lib, ... }:
{ flake, config, pkgs, lib, ... }:
let
userConfig = flake.config.people.users.${config.home.username};
in
{
home.packages = with pkgs; [
_1password
@ -20,4 +23,18 @@
};
};
};
# https://developer.1password.com/docs/ssh/git-commit-signing/
#
# For this to work on GitHub, you must have added the SSH pub key as a signing key, see
# https://1password.community/discussion/comment/667515/#Comment_667515
programs.git.includes = [{
condition = "gitdir:~/code/**"; # Personal repos only
contents = {
user.signingKey = userConfig.sshKey;
gpg.format = "ssh";
gpg.ssh.program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign";
commit.gpgsign = true;
};
}];
}