full rewrite, first commit
This commit is contained in:
commit
a83c37a638
24 changed files with 4358 additions and 0 deletions
49
modules/home/tools/git/default.nix
Normal file
49
modules/home/tools/git/default.nix
Normal file
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib) types mkEnableOption mkIf;
|
||||
inherit (lib.${namespace}) mkOpt enabled;
|
||||
|
||||
cfg = config.${namespace}.tools.git;
|
||||
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 "AA5E5A3C" "The key ID to sign commits with.";
|
||||
signByDefault = mkOpt types.bool true "Whether to sign commits by default.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
inherit (cfg) userName userEmail;
|
||||
lfs = enabled;
|
||||
signing = {
|
||||
key = cfg.signingKey;
|
||||
inherit (cfg) signByDefault;
|
||||
};
|
||||
extraConfig = {
|
||||
init = {
|
||||
defaultBranch = "main";
|
||||
};
|
||||
pull = {
|
||||
rebase = true;
|
||||
};
|
||||
push = {
|
||||
autoSetupRemote = true;
|
||||
};
|
||||
core = {
|
||||
whitespace = "trailing-space,space-before-tab";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue