nixos-config/modules/nixos/tools/git/default.nix
Christoph Hollizeck 0c5f9e6a67 improvement: git, hyprland, steam
added gitbutler, introduced maintenance for nixpkgs, cleaned up some files, keyring should now unlock ad login
2024-10-10 20:12:24 +02:00

56 lines
1.2 KiB
Nix

{
options,
config,
lib,
pkgs,
...
}:
with lib;
with lib.wyrdgard;
let
cfg = config.wyrdgard.tools.git;
user = config.wyrdgard.user;
in
{
options.wyrdgard.tools.git = with types; {
enable = mkBoolOpt true "Wether or not to enable git (Default enabled)";
userName = mkOpt types.str user.fullName "The name to use git with";
userEmail = mkOpt types.str user.email "The email to use git with";
signingKey = mkOpt types.str "6995A5FF33791B7B" "The key ID to sign commits with.";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
git
gitAndTools.gh
gitbutler
];
wyrdgard.home.extraOptions = {
programs.git = {
enable = true;
inherit (cfg) userName userEmail;
lfs.enable = true;
signing = {
key = cfg.signingKey;
signByDefault = mkIf gpg.enable true;
};
extraConfig = {
init = {
defaultBranch = "main";
};
pull = {
rebase = true;
};
push = {
autoSetupRemote = true;
};
safe = {
directory = "${config.users.users.${user.name}.home}/projects/config";
};
};
};
};
};
}