Git: Difference between revisions

Kaya (talk | contribs)
Update aliases from deprecated options
Kaya (talk | contribs)
Replace deprecated extraConfig with settings
 
Line 51: Line 51:
Configure git-credential-helper with libsecret:
Configure git-credential-helper with libsecret:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">{ pkgs, ... }:
{ pkgs, ... }:


{
{
Line 58: Line 57:
     enable = true;
     enable = true;
     package = pkgs.git.override { withLibsecret = true; };
     package = pkgs.git.override { withLibsecret = true; };
     extraConfig = {
     settings = {
       credential.helper = "libsecret";
       credential.helper = "libsecret";
     };
     };
   };
   };
}
}</syntaxhighlight>
</syntaxhighlight>


For example to add additional configuration you can specify options in an attribute set, so to add something like this:
For example to add additional configuration you can specify options in an attribute set, so to add something like this:
Line 80: Line 78:
   programs.git = {
   programs.git = {
     enable = true;
     enable = true;
     extraConfig = {
     settings = {
       push = { autoSetupRemote = true; };
       push = { autoSetupRemote = true; };
     };
     };
Line 96: Line 94:
       signByDefault = true;
       signByDefault = true;
     };
     };
     extraConfig = {
     settings = {
       gpg = {
       gpg = {
         format = "ssh";
         format = "ssh";
Line 103: Line 101:
   };
   };
}
}
</syntaxhighlight>However, note that this will also require Home Manager to manage your SSH configuration:<syntaxhighlight lang="nix">
</syntaxhighlight>However, note that this will also require Home Manager to manage your SSH configuration:<syntaxhighlight lang="nix">{     
{     
   programs.ssh = {
   programs.ssh = {
     enable = true;
     enable = true;
     addKeysToAgent = "yes";
     addKeysToAgent = "yes";
   };
   };
}
}</syntaxhighlight>
</syntaxhighlight>


== Management of the <code>nixpkgs</code> git repository ==
== Management of the <code>nixpkgs</code> git repository ==