mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-09 02:21:05 +01:00
git: extraConfig -> settings
Remove string support and convert to rfc42 settings option Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
85cd07b8b0
commit
ac7c05a90c
10 changed files with 17 additions and 65 deletions
|
|
@ -64,7 +64,7 @@ in
|
|||
programs.git.attributes = lib.mkIf (cfg.enableGitIntegration && (cfg.package != null)) [
|
||||
"*.lockb binary diff=lockb"
|
||||
];
|
||||
programs.git.extraConfig.diff.lockb = lib.mkIf (cfg.enableGitIntegration && (cfg.package != null)) {
|
||||
programs.git.settings.diff.lockb = lib.mkIf (cfg.enableGitIntegration && (cfg.package != null)) {
|
||||
textconv = lib.getExe cfg.package;
|
||||
binary = true;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ in
|
|||
fi
|
||||
'';
|
||||
|
||||
programs.git.extraConfig.credential = mkIf cfg.gitCredentialHelper.enable (
|
||||
programs.git.settings.credential = mkIf cfg.gitCredentialHelper.enable (
|
||||
builtins.listToAttrs (
|
||||
map (
|
||||
host:
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ in
|
|||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
programs.git.extraConfig.credential =
|
||||
programs.git.settings.credential =
|
||||
let
|
||||
helperConfig =
|
||||
let
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ in
|
|||
config = lib.mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
programs.git.extraConfig.credential.helper = lib.mkAfter [
|
||||
programs.git.settings.credential.helper = lib.mkAfter [
|
||||
(
|
||||
"${cfg.package}/bin/git-credential-oauth"
|
||||
+ lib.optionalString (cfg.extraFlags != [ ]) " ${lib.strings.concatStringsSep " " cfg.extraFlags}"
|
||||
|
|
|
|||
|
|
@ -111,8 +111,8 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = types.either types.lines gitIniType;
|
||||
settings = mkOption {
|
||||
type = gitIniType;
|
||||
default = { };
|
||||
example = {
|
||||
core = {
|
||||
|
|
@ -121,8 +121,8 @@ in
|
|||
url."ssh://git@host".insteadOf = "otherhost";
|
||||
};
|
||||
description = ''
|
||||
Additional configuration to add. The use of string values is
|
||||
deprecated and will be removed in the future.
|
||||
Configuration written to {file}`$XDG_CONFIG_HOME/git/config`.
|
||||
See {manpage}`git-config(1)` for details.
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
@ -440,20 +440,8 @@ in
|
|||
|
||||
(mkIf (cfg.aliases != { }) { programs.git.iniContent.alias = cfg.aliases; })
|
||||
|
||||
(mkIf (lib.isAttrs cfg.extraConfig) {
|
||||
programs.git.iniContent = cfg.extraConfig;
|
||||
})
|
||||
|
||||
(mkIf (lib.isString cfg.extraConfig) {
|
||||
warnings = [
|
||||
''
|
||||
Using programs.git.extraConfig as a string option is
|
||||
deprecated and will be removed in the future. Please
|
||||
change to using it as an attribute set instead.
|
||||
''
|
||||
];
|
||||
|
||||
xdg.configFile."git/config".text = cfg.extraConfig;
|
||||
(mkIf (cfg.settings != { }) {
|
||||
programs.git.iniContent = cfg.settings;
|
||||
})
|
||||
|
||||
(mkIf (cfg.includes != [ ]) {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ in
|
|||
|
||||
programs.git = {
|
||||
attributes = [ "* merge=mergiraf" ];
|
||||
extraConfig = {
|
||||
settings = {
|
||||
merge = {
|
||||
mergiraf = {
|
||||
name = "mergiraf";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue