33 lines
630 B
Nix
33 lines
630 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
cfg = config.samfelag.modules.dev.git;
|
|
in
|
|
{
|
|
options.samfelag.modules.dev.git = with lib.types; {
|
|
enable = lib.mkEnableOption "git";
|
|
userName = lib.my.mkOpt str config.user.name;
|
|
userEmail = lib.my.mkOpt (nullOr str) null;
|
|
};
|
|
config = lib.mkIf cfg.enable {
|
|
environment.systemPackages = with pkgs; [
|
|
git
|
|
];
|
|
hm.programs.git = {
|
|
enable = true;
|
|
|
|
userName = cfg.userName;
|
|
userEmail = cfg.userEmail;
|
|
|
|
ignores = [
|
|
".direnv"
|
|
".project"
|
|
];
|
|
|
|
extraConfig = {
|
|
init.defaultBranch = "main";
|
|
};
|
|
};
|
|
};
|
|
}
|