#6 trying to sign commits
This commit is contained in:
parent
45487e7d1b
commit
120baa6ab8
7 changed files with 117 additions and 11 deletions
|
@ -10,12 +10,14 @@ with lib.wyrdgard;
|
|||
let
|
||||
cfg = config.wyrdgard.tools.git;
|
||||
user = config.wyrdgard.user;
|
||||
gpg = config.wyrdgard.security.gpg;
|
||||
in
|
||||
{
|
||||
options.wyrdgard.tools.git = with types; {
|
||||
enable = mkBoolOpt true "Wether or not to enable git (Default enabled)";
|
||||
userName = mkOpt types.str user.fullName "The name to use git with";
|
||||
userEmail = mkOpt types.str user.email "The email to use git with";
|
||||
signingKey = mkOpt types.str "A8185688CDE3921F" "The key ID to sign commits with.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
@ -24,18 +26,28 @@ in
|
|||
gitAndTools.gh
|
||||
];
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
lfs.enable = true;
|
||||
config = {
|
||||
init = {
|
||||
defaultBranch = "main";
|
||||
wyrdgard.home.extraOptions = {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
inherit (cfg) userName userEmail;
|
||||
lfs.enable = true;
|
||||
signing = {
|
||||
key = cfg.signingKey;
|
||||
signByDefault = mkIf gpg.enable true;
|
||||
};
|
||||
pull = {
|
||||
rebase = false;
|
||||
};
|
||||
push = {
|
||||
autoSetupRemote = true;
|
||||
extraConfig = {
|
||||
init = {
|
||||
defaultBranch = "main";
|
||||
};
|
||||
pull = {
|
||||
rebase = false;
|
||||
};
|
||||
push = {
|
||||
autoSetupRemote = true;
|
||||
};
|
||||
safe = {
|
||||
directory = "${config.users.users.${user.name}.home}/projects/config";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue