Major config overhaul: use custom modules, setup for multi-host config, and less boilerplate
This commit is contained in:
22
modules/user/git/git.nix
Normal file
22
modules/user/git/git.nix
Normal file
@ -0,0 +1,22 @@
|
||||
{ config, lib, pkgs, osConfig, ... }:
|
||||
|
||||
let
|
||||
cfg = config.userSettings.git;
|
||||
in {
|
||||
options = {
|
||||
userSettings.git = {
|
||||
enable = lib.mkEnableOption "Enable git";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = [ pkgs.git ];
|
||||
programs.git.enable = true;
|
||||
programs.git.userName = config.userSettings.name;
|
||||
programs.git.userEmail = config.userSettings.email;
|
||||
programs.git.extraConfig = {
|
||||
init.defaultBranch = "main";
|
||||
safe.directory = [ osConfig.systemSettings.dotfilesDir (config.home.homeDirectory + "/.cache/nix/tarball-cache") ];
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user