fix(git): update from extraConfig to settings
This commit is contained in:
parent
d6f5f140d3
commit
d187b96054
1 changed files with 12 additions and 8 deletions
|
|
@ -13,24 +13,28 @@ let
|
|||
user = config.${namespace}.user;
|
||||
in
|
||||
{
|
||||
options.${namespace}.tools.git = {
|
||||
enable = mkEnableOption "Git";
|
||||
userName = mkOpt types.str "Philipp" "The name to configure git with.";
|
||||
userEmail = mkOpt types.str "philipp@boehm.sh" "The email to configure git with.";
|
||||
signingKey = mkOpt types.str "0F21E3C3" "The key ID to sign commits with.";
|
||||
signByDefault = mkOpt types.bool true "Whether to sign commits by default.";
|
||||
options.${namespace} = {
|
||||
tools.git = {
|
||||
enable = mkEnableOption "Git";
|
||||
signingKey = mkOpt types.str "0F21E3C3" "The key ID to sign commits with.";
|
||||
signByDefault = mkOpt types.bool true "Whether to sign commits by default.";
|
||||
};
|
||||
user = {
|
||||
name = mkOpt types.str "Philipp" "The name to configure git with.";
|
||||
email = mkOpt types.str "philipp@boehm.sh" "The email to configure git with.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
inherit (cfg) userName userEmail;
|
||||
lfs = enabled;
|
||||
signing = {
|
||||
key = cfg.signingKey;
|
||||
inherit (cfg) signByDefault;
|
||||
};
|
||||
extraConfig = {
|
||||
settings = {
|
||||
inherit user;
|
||||
init = {
|
||||
defaultBranch = "main";
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue