home-manager: add signing option to git
This commit is contained in:
parent
29d7585e27
commit
45abb88221
3 changed files with 52 additions and 30 deletions
|
@ -8,9 +8,20 @@ in
|
|||
{
|
||||
options.custom-hm.git = {
|
||||
enable = mkEnableOption "Enable git configuration";
|
||||
signing = mkOption {
|
||||
type = types.submodule {
|
||||
options = {
|
||||
enable = mkEnableOption "Git ssh signing";
|
||||
keyFile = mkOption {
|
||||
type = types.str;
|
||||
default = "~/.ssh/id_ed25519_sk";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
config = {
|
||||
programs.git = {
|
||||
programs.git = mkIf cfg.enable {
|
||||
enable = true;
|
||||
delta.enable = true;
|
||||
userName = "Xinyang Li";
|
||||
|
@ -21,6 +32,17 @@ in
|
|||
d = "diff";
|
||||
s = "status";
|
||||
};
|
||||
signing = mkIf cfg.signing.enable {
|
||||
signByDefault = true;
|
||||
key = cfg.signing.keyFile;
|
||||
};
|
||||
|
||||
extraConfig.user = mkIf cfg.signing.enable {
|
||||
signingkey = cfg.signing.keyFile;
|
||||
};
|
||||
extraConfig.gpg = mkIf cfg.signing.enable {
|
||||
format = "ssh";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue