nixos-config/backup/modules/users/git/default.nix
2021-11-12 07:23:46 +01:00

41 lines
808 B
Nix

{ 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; [
];
};
}