{ config, config', lib, ... }: with lib; let cfg = config.myOptions.programs.git; in { options.myOptions.programs.git = { enable = mkEnableOption "git"; userName = mkOption { type = types.str; description = "git username"; }; userEmail = mkOption { type = types.str; description = "git email"; }; signingKey = mkOption { type = types.str; description = "git commit signing key"; }; editor = mkOption { type = types.str; default = "$EDITOR"; description = "commit message editor"; }; defaultBranch = mkOption { type = types.str; default = "master"; description = "default git branch"; }; }; config = mkIf cfg.enable { home-manager.users.${config'.username} = { programs.git = { inherit (cfg) enable userName userEmail; signing = { key = cfg.signingKey; signByDefault = true; }; includes = [ { contents = { core = { editor = cfg.editor; pager = "${pkgs.delta}/bin/delta"; }; init.defaultBranch = cfg.defaultBranch; push.autoSetupRemote = true; commit.verbose = true; merge.conflictstyle = "zdiff3"; interactive.diffFilter = "${pkgs.delta}/bin/delta --color-only"; }; } ]; }; }; }; }