mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 00:38:12 +09:00
fix
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.my.applications.git;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./system.nix
|
||||
./home.nix
|
||||
];
|
||||
|
||||
options.my.applications.git = {
|
||||
enable = lib.mkEnableOption "git version control";
|
||||
userName = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "moons-14";
|
||||
description = "Git user name";
|
||||
};
|
||||
userEmail = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "moons@moons14.com";
|
||||
description = "Git user email";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
my.applications.git.system.enable = lib.mkDefault true;
|
||||
my.applications.git.homeManager.enable = lib.mkDefault true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.my.applications.git;
|
||||
hmCfg = config.my.applications.git.homeManager;
|
||||
in
|
||||
{
|
||||
options.my.applications.git.homeManager = {
|
||||
enable = lib.mkEnableOption "git home-manager configuration";
|
||||
};
|
||||
|
||||
config.home-manager.sharedModules = [
|
||||
{
|
||||
config = lib.mkIf hmCfg.enable {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
ignores = [
|
||||
".direnv/"
|
||||
".envrc"
|
||||
"!.envrc.example"
|
||||
];
|
||||
|
||||
signing = {
|
||||
key = "~/.ssh/id_ed25519.pub";
|
||||
signByDefault = true;
|
||||
};
|
||||
|
||||
settings = {
|
||||
user.name = cfg.userName;
|
||||
user.email = cfg.userEmail;
|
||||
push.default = "simple";
|
||||
credential.helper = "cache --timeout=7200";
|
||||
init.defaultBranch = "main";
|
||||
log.decorate = "full";
|
||||
log.date = "iso";
|
||||
merge.conflictStyle = "diff3";
|
||||
|
||||
gpg.format = "ssh";
|
||||
tag.gpgSign = true;
|
||||
|
||||
alias = {
|
||||
br = "branch --sort=-committerdate";
|
||||
co = "checkout";
|
||||
df = "diff";
|
||||
com = "commit -a";
|
||||
gs = "stash";
|
||||
gp = "pull";
|
||||
lg = "log --graph --pretty=format:'%Cred%h%Creset - %C(yellow)%d%Creset %s %C(green)(%cr)%C(bold blue) <%an>%Creset' --abbrev-commit";
|
||||
st = "status";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.my.applications.git.system;
|
||||
in
|
||||
{
|
||||
options.my.applications.git.system = {
|
||||
enable = lib.mkEnableOption "git system configuration";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
git # Distributed version control system
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user