Skip to content

Commit c0cc78d

Browse files
committed
chore: update renamed options
1 parent b544752 commit c0cc78d

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

docs/src/reference/profiles/user.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ This option is required when [`skipTutorial`](/reference/root.md#skiptutorial) i
2424

2525
**Type:** null or string
2626

27-
**Default:** `config.programs.git.userEmail`
27+
**Default:** `config.programs.git.settings.user.email`
2828

2929
**Example:** `email@example.com`
3030

@@ -42,6 +42,6 @@ This option is required when [`skipTutorial`](/reference/root.md#skiptutorial) i
4242

4343
**Type:** null or string
4444

45-
**Default:** `config.programs.git.userName`
45+
**Default:** `config.programs.git.settings.user.name`
4646

4747
**Example:** `John Doe`

docs/src/reference/user.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This option is required when [`skipTutorial`](/reference/root.md#skiptutorial) i
2525

2626
**Type:** null or string
2727

28-
**Default:** `config.programs.git.userEmail`
28+
**Default:** `config.programs.git.settings.user.email`
2929

3030
**Example:** `email@example.com`
3131

@@ -43,6 +43,6 @@ This option is required when [`skipTutorial`](/reference/root.md#skiptutorial) i
4343

4444
**Type:** null or string
4545

46-
**Default:** `config.programs.git.userName`
46+
**Default:** `config.programs.git.settings.user.name`
4747

4848
**Example:** `John Doe`

modules/user/profile-options.nix

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
{
44
email = lib.mkOption {
55
type = with lib.types; nullOr str;
6-
default = config.programs.git.userEmail;
7-
defaultText = "config.programs.git.userEmail";
6+
# TODO can be removed in the future when deprecated `config.programs.git.userEmail` is removed
7+
default = config.programs.git.userEmail or (lib.attrByPath ["settings" "user" "email"] null config.programs.git);
8+
defaultText = "config.programs.git.userEmail or config.programs.git.settings.user.email";
89
example = "email@example.com";
910
description = ''
1011
Email to use as commit author email.
@@ -20,8 +21,9 @@
2021

2122
name = lib.mkOption {
2223
type = with lib.types; nullOr str;
23-
default = config.programs.git.userName;
24-
defaultText = "config.programs.git.userName";
24+
# TODO can be removed in the future when deprecated `config.programs.git.userName` is removed
25+
default = config.programs.git.userName or (lib.attrByPath ["settings" "user" "name"] null config.programs.git);
26+
defaultText = "config.programs.git.userName or config.programs.git.settings.user.name";
2527
example = "John Doe";
2628
description = ''
2729
Name to use as commit author name.

0 commit comments

Comments
 (0)