git: use attrsOf instead of attrs
This makes sure that values added to
programs.git.aliases
or
programs.git.extraConfig
are merged as expected.
Also add a few option examples.
This commit is contained in:
parent
0590c2a4f6
commit
445c0b1482
3 changed files with 50 additions and 30 deletions
|
|
@ -4,33 +4,41 @@ with lib;
|
|||
|
||||
{
|
||||
config = {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
aliases = {
|
||||
a1 = "foo";
|
||||
a2 = "bar";
|
||||
};
|
||||
extraConfig = {
|
||||
extra = {
|
||||
name = "value";
|
||||
programs.git = mkMerge [
|
||||
{
|
||||
enable = true;
|
||||
aliases = {
|
||||
a1 = "foo";
|
||||
a2 = "bar";
|
||||
};
|
||||
};
|
||||
ignores = [ "*~" "*.swp" ];
|
||||
includes = [
|
||||
{ path = "~/path/to/config.inc"; }
|
||||
{
|
||||
path = "~/path/to/conditional.inc";
|
||||
condition = "gitdir:~/src/dir";
|
||||
}
|
||||
];
|
||||
signing = {
|
||||
gpgPath = "path-to-gpg";
|
||||
key = "00112233445566778899AABBCCDDEEFF";
|
||||
signByDefault = true;
|
||||
};
|
||||
userEmail = "user@example.org";
|
||||
userName = "John Doe";
|
||||
};
|
||||
extraConfig = {
|
||||
extra = {
|
||||
name = "value";
|
||||
};
|
||||
};
|
||||
ignores = [ "*~" "*.swp" ];
|
||||
includes = [
|
||||
{ path = "~/path/to/config.inc"; }
|
||||
{
|
||||
path = "~/path/to/conditional.inc";
|
||||
condition = "gitdir:~/src/dir";
|
||||
}
|
||||
];
|
||||
signing = {
|
||||
gpgPath = "path-to-gpg";
|
||||
key = "00112233445566778899AABBCCDDEEFF";
|
||||
signByDefault = true;
|
||||
};
|
||||
userEmail = "user@example.org";
|
||||
userName = "John Doe";
|
||||
}
|
||||
|
||||
{
|
||||
aliases.a2 = mkForce "baz";
|
||||
extraConfig.extra.boolean = true;
|
||||
extraConfig.extra.integer = 38;
|
||||
}
|
||||
];
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.config/git/config
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue