-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
101 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{ | ||
config, | ||
lib, | ||
pkgs, | ||
namespace, | ||
... | ||
}: | ||
let | ||
inherit (lib) mkIf types; | ||
inherit (lib.${namespace}) mkOpt mkBoolOpt enabled; | ||
inherit (config.${namespace}) user; | ||
|
||
cfg = config.${namespace}.cli.programs.git; | ||
in | ||
{ | ||
options.${namespace}.cli.programs.git = with types; { | ||
enable = mkBoolOpt false "Whether or not to enable git."; | ||
|
||
signByDefault = mkOpt bool true "Whether to sign commits by default."; | ||
signingKey = | ||
mkOpt str "EEFBCC3AC529CFD1943DA75CBDD57BE99D555965" | ||
"The GnuPG signing key fingerprint sign commits with."; | ||
userName = mkOpt str user.fullName "The name to configure git with."; | ||
userEmail = mkOpt str user.email "The email to configure git with."; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
${namespace}.editors.emacs = enabled; | ||
|
||
programs.git = { | ||
enable = true; | ||
package = pkgs.gitFull; | ||
inherit (cfg) userName userEmail; | ||
|
||
signing = { | ||
key = cfg.signingKey; | ||
inherit (cfg) signByDefault; | ||
}; | ||
|
||
extraConfig = { | ||
commit.gpgsign = true; | ||
|
||
core = { | ||
editor = "emacs"; | ||
pager = "delta"; | ||
filemode = "false"; | ||
}; | ||
|
||
color = { | ||
ui = true; | ||
}; | ||
|
||
fetch = { | ||
prune = true; | ||
}; | ||
|
||
interactive = { | ||
diffFitler = "delta --color-only"; | ||
}; | ||
|
||
delta = { | ||
enable = true; | ||
navigate = true; | ||
light = false; | ||
side-by-side = false; | ||
line-numbers = true; | ||
options.syntax-theme = "dracula"; | ||
}; | ||
|
||
pull = { | ||
ff = "only"; | ||
}; | ||
|
||
push = { | ||
default = "current"; | ||
autoSetupRemote = true; | ||
}; | ||
|
||
safe = { | ||
directory = [ | ||
"~/${namespace}/" | ||
"/etc/nixos" | ||
]; | ||
}; | ||
|
||
init = { | ||
defaultBranch = "main"; | ||
}; | ||
}; | ||
}; | ||
|
||
home.packages = with pkgs; [ gitmoji-cli ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,24 @@ | ||
{ | ||
config, | ||
lib, | ||
pkgs, | ||
namespace, | ||
... | ||
}: | ||
let | ||
inherit (lib) mkIf types; | ||
inherit (lib.${namespace}) mkOpt mkBoolOpt enabled; | ||
inherit (config.${namespace}) user; | ||
inherit (lib) mkIf; | ||
inherit (lib.${namespace}) mkBoolOpt; | ||
|
||
cfg = config.${namespace}.cli.programs.git; | ||
cfg = config.${namespace}.cli.programs.git-cliff; | ||
in | ||
{ | ||
options.${namespace}.cli.programs.git = with types; { | ||
enable = mkBoolOpt false "Whether or not to enable git."; | ||
options.${namespace}.cli.programs.git-cliff = { | ||
enable = mkBoolOpt false "Whether or not to enable git-cliff."; | ||
|
||
signByDefault = mkOpt bool true "Whether to sign commits by default."; | ||
signingKey = | ||
mkOpt str "EEFBCC3AC529CFD1943DA75CBDD57BE99D555965" | ||
"The GnuPG signing key fingerprint sign commits with."; | ||
userName = mkOpt str user.fullName "The name to configure git with."; | ||
userEmail = mkOpt str user.email "The email to configure git with."; | ||
}; | ||
|
||
config = mkIf cfg.enable { | ||
${namespace}.editors.emacs = enabled; | ||
|
||
programs.git = { | ||
programs.git-cliff = { | ||
enable = true; | ||
package = pkgs.gitFull; | ||
inherit (cfg) userName userEmail; | ||
|
||
signing = { | ||
key = cfg.signingKey; | ||
inherit (cfg) signByDefault; | ||
}; | ||
|
||
extraConfig = { | ||
commit.gpgsign = true; | ||
|
||
core = { | ||
editor = "emacs"; | ||
pager = "delta"; | ||
filemode = "false"; | ||
}; | ||
|
||
color = { | ||
ui = true; | ||
}; | ||
|
||
fetch = { | ||
prune = true; | ||
}; | ||
|
||
interactive = { | ||
diffFitler = "delta --color-only"; | ||
}; | ||
|
||
delta = { | ||
enable = true; | ||
navigate = true; | ||
light = false; | ||
side-by-side = false; | ||
line-numbers = true; | ||
options.syntax-theme = "dracula"; | ||
}; | ||
|
||
pull = { | ||
ff = "only"; | ||
}; | ||
|
||
push = { | ||
default = "current"; | ||
autoSetupRemote = true; | ||
}; | ||
|
||
safe = { | ||
directory = [ | ||
"~/${namespace}/" | ||
"/etc/nixos" | ||
]; | ||
}; | ||
|
||
init = { | ||
defaultBranch = "main"; | ||
}; | ||
}; | ||
}; | ||
|
||
home.packages = with pkgs; [ gitmoji-cli ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters