Git

Decknix provides a sensible Git configuration with modern tooling.

Default Settings

SettingValueDescription
init.defaultBranchmainDefault branch name
pull.rebasetrueRebase on pull instead of merge
push.autoSetupRemotetrueAuto-create remote tracking branch
core.pagerdeltaSyntax-highlighted diffs
lfs.enabletrueGit Large File Storage

Delta Integration

Delta provides beautiful, syntax-highlighted diffs in the terminal with line numbers.

Customising Git

# ~/.config/decknix/local/home.nix
{ ... }: {
  programs.git.settings = {
    user.email = "you@example.com";
    user.name = "Your Name";
    core.editor = "emacsclient -c";
  };
}

Conditional Includes

Use different identities for different directories:

{ ... }: {
  programs.git.includes = [{
    condition = "gitdir:~/Code/work/";
    contents = {
      user.email = "you@company.com";
      user.name = "Your Name";
      commit.gpgsign = true;
    };
  }];
}

Magit (Emacs Git Interface)

The Emacs module includes Magit — a full Git interface inside Emacs:

  • C-x g → Git status
  • Stage, commit, push, pull, rebase — all from keyboard
  • Forge — manage GitHub PRs and issues without leaving Emacs
  • code-review — inline PR review with comments

See Secrets & Authentication for Forge token setup.

GitHub CLI

The gh CLI is installed by default. Decknix also auto-configures authenticated GitHub API access for Nix itself via decknix.nix.githubAuth (see Secrets).