nixos-config/modules/users/git/default.nix

42 lines
808 B
Nix
Raw Normal View History

2021-10-05 23:45:02 +02:00
{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.erwin.git;
in {
options.erwin.git = {
enable = mkOption {
description = "Enable git";
type = types.bool;
default = false;
};
userName = mkOption {
description = "Name for git";
type = types.str;
default = "Erwin Boskma";
};
userEmail = mkOption {
description = "Email for git";
type = types.str;
default = "erwin@datarift.nl";
};
};
config = mkIf (cfg.enable) {
programs.git = {
enable = true;
userName = cfg.userName;
userEmail = cfg.userEmail;
extraConfig = {
credential.helper = "${pkgs.git.override { withLibsecret = true; }}/bin/git-credential-libsecret";
};
};
home.packages = with pkgs; [
];
};
}