Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

programs.git.enable

Whether to enable Git.

Type: boolean

Default:

false

Example:

true

Declared by:

programs.git.package

The git package to use. Use pkgs.gitFull to gain access to git send-email for instance.

Type: null or package

Default:

pkgs.git

Example:

pkgs.gitFull

Declared by:

programs.git.attributes

List of defining attributes set globally.

Type: list of string

Default:

[ ]

Example:

[
  "*.pdf diff=pdf"
]

Declared by:

programs.git.hooks

Configuration helper for Git hooks. See https://git-scm.com/docs/githooks for reference.

Type: attribute set of absolute path

Default:

{ }

Example:

{
  pre-commit = ./pre-commit-script;
}

Declared by:

programs.git.ignores

List of paths that should be globally ignored.

Type: list of string

Default:

[ ]

Example:

[
  "*~"
  "*.swp"
]

Declared by:

programs.git.includes

List of configuration files to include.

Type: list of (submodule)

Default:

[ ]

Example:

[
  {
    path = "~/path/to/config.inc";
  }
  {
    condition = "gitdir:~/src/dir";
    path = "~/path/to/conditional.inc";
  }
]

Declared by:

programs.git.includes.*.condition

Include this configuration only when condition matches. Allowed conditions are described in git-config(1).

Type: null or string

Default:

null

Declared by:

programs.git.includes.*.contentSuffix

Nix store name for the git configuration text file, when generating the configuration text from nix options.

Type: string

Default:

"gitconfig"

Declared by:

programs.git.includes.*.contents

Configuration to include. If empty then a path must be given.

This follows the configuration structure as described in git-config(1).

Type: attribute set of anything

Default:

{ }

Example:

{
  commit = {
    gpgSign = true;
  };
  user = {
    email = "bob@work.example.com";
    name = "Bob Work";
    signingKey = "1A2B3C4D5E6F7G8H";
  };
}

Declared by:

programs.git.includes.*.path

Path of the configuration file to include.

Type: string or absolute path

Declared by:

programs.git.lfs.enable

Whether to enable Git Large File Storage.

Type: boolean

Default:

false

Example:

true

Declared by:

programs.git.lfs.package

The git-lfs package to use.

Type: null or package

Default:

pkgs.git-lfs

Declared by:

programs.git.lfs.skipSmudge

Skip automatic downloading of objects on clone or pull. This requires a manual git lfs pull every time a new commit is checked out on your repository.

Type: boolean

Default:

false

Declared by:

programs.git.maintenance.enable

Enable the automatic git maintenance.

If you have SSH remotes, set programs.git.package to a git version with SSH support (eg: pkgs.gitFull).

See https://git-scm.com/docs/git-maintenance.

Type: boolean

Default:

false

Example:

true

Declared by:

programs.git.maintenance.repositories

Repositories on which git maintenance should run.

Should be a list of absolute paths.

Type: list of string

Default:

[ ]

Declared by:

programs.git.maintenance.timers

Systemd timers to create for scheduled git maintenance.

Key is passed to --schedule argument in git maintenance run and value is passed to Timer.OnCalendar in systemd.user.timers.

Type: attribute set of string

Default:

{
  daily = "Tue..Sun *-*-* 0:53:00";
  hourly = "*-*-* 1..23:53:00";
  weekly = "Mon 0:53:00";
}

Declared by:

programs.git.settings

Configuration written to $XDG_CONFIG_HOME/git/config. This may be either a single attrset of Git settings or an ordered list of attrset fragments when repeated sections or explicit ordering matter.

See git-config(1) for details.

Type: (attribute set of attribute set of (string or boolean or signed integer or list of (string or boolean or signed integer) or attribute set of (string or boolean or signed integer or list of (string or boolean or signed integer)))) or list of attribute set of attribute set of (string or boolean or signed integer or list of (string or boolean or signed integer) or attribute set of (string or boolean or signed integer or list of (string or boolean or signed integer)))

Default:

{ }

Example:

[
  {
    core = {
      whitespace = "trailing-space,space-before-tab";
    };
    url = {
      "ssh://git@host" = {
        insteadOf = "otherhost";
      };
    };
  }
  {
    credential = {
      "https://example.com" = {
        helper = "";
      };
    };
  }
  {
    credential = {
      "https://example.com" = {
        helper = "oauth";
      };
    };
  }
]

Declared by:

programs.git.signing.format

The signing method to use when signing commits and tags. Valid values are openpgp (OpenPGP/GnuPG), ssh (SSH), and x509 (X.509 certificates).

Type: null or one of “openpgp”, “ssh”, “x509”

Default:

if lib.versionAtLeast config.home.stateVersion "25.05" then null else "openpgp"

Declared by:

programs.git.signing.key

The default signing key fingerprint.

Set to null to let the signer decide what signing key to use depending on commit’s author.

Type: null or string

Default:

null

Declared by:

programs.git.signing.signByDefault

Whether commits and tags should be signed by default.

Type: null or boolean

Default:

null

Declared by:

programs.git.signing.signer

Path to signer binary to use.

Type: null or string

Default:

null

Declared by: