Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Local/work-specific configuration files
.zshenv.local
git/.config/git/config.local

# Nix
result
Expand Down
4 changes: 4 additions & 0 deletions git/.config/git/.gitignore_global
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.idea/
.vscode/

.tool-versions
62 changes: 62 additions & 0 deletions git/.config/git/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Git Configuration

This directory contains the shared git configuration that works across all platforms (NixOS, macOS, Linux, WSL).

## OS-Specific Configurations

You can create OS-specific git configuration files that will be automatically included:

### Setup

Add the following to the bottom of `config`:

```gitconfig
# OS-specific configurations
# These will be loaded if the files exist
[include]
path = ~/.config/git/config.local
path = ~/.config/git/config.darwin
path = ~/.config/git/config.linux
path = ~/.config/git/config.wsl
```

### Create OS-Specific Files

Then create the appropriate files:

- **`config.darwin`** - macOS-specific settings
- **`config.linux`** - Native Linux-specific settings
- **`config.wsl`** - WSL-specific settings
- **`config.local`** - Machine-specific settings (not tracked in git)

### Example OS-Specific Files

**config.darwin:**
```gitconfig
# macOS-specific git configuration

[core]
# macOS specific settings
```

**config.linux:**
```gitconfig
# Linux-specific git configuration

[core]
# Linux specific settings
```

**config.wsl:**
```gitconfig
# WSL-specific git configuration

[core]
# WSL might need different autocrlf handling
```

### Notes

- Git will silently ignore include paths that don't exist
- Settings in later files override earlier ones
- You can add `config.local` to `.gitignore` for machine-specific settings
20 changes: 20 additions & 0 deletions git/.config/git/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Git configuration
# This file is managed by dotfiles and symlinked to ~/.config/git/config

[user]
name = "user3301"
email = "26126682+user3301@users.noreply.github.com"

[core]
autocrlf = "input"
editor = nvim
excludesfile = ~/.config/git/.gitignore_global

[commit]
gpgsign = true

# machine-specific configuration will be configurated there
# (eg: signkingkey)
[include]
path = ~/.config/git/config.local

8 changes: 1 addition & 7 deletions home/archlinux.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
./modules/common.nix
./modules/shell.nix
./modules/dev-tools.nix
./modules/git.nix
./modules/neovim.nix
./modules/terminal.nix
./modules/editors.nix
Expand All @@ -30,13 +31,6 @@
# Example: Nix-specific or bleeding-edge tools
];

# Git configuration
programs.git = {
enable = true;
userName = "user3301";
userEmail = "26126682+user3301@users.noreply.github.com";
};

# Targets for non-NixOS systems
targets.genericLinux.enable = true;

Expand Down
8 changes: 1 addition & 7 deletions home/darwin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
./modules/common.nix
./modules/shell.nix
./modules/dev-tools.nix
./modules/git.nix
./modules/neovim.nix
./modules/terminal.nix
./modules/editors.nix
Expand All @@ -26,13 +27,6 @@
xdg.configFile."aerospace".source = config.lib.file.mkOutOfStoreSymlink
"${config.home.homeDirectory}/dotfiles/aerospace/.config/aerospace";

# Git configuration
programs.git = {
enable = true;
userName = "gaiz";
userEmail = "26126682+user3301@users.noreply.github.com";
};

# Home Manager state version
home.stateVersion = "24.05";
}
19 changes: 0 additions & 19 deletions home/modules/dev-tools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
home.packages = with pkgs; [
vim

# Version control
git
gh # GitHub CLI
lazygit

# Modern CLI tools
ripgrep
fd
Expand All @@ -33,18 +28,4 @@
# AI
pkgs.claude-code
];

# Git configuration
programs.git = {
enable = true;
# User will configure name/email in their local .gitconfig or via system config
};

# GitHub CLI
programs.gh = {
enable = true;
settings = {
git_protocol = "ssh";
};
};
}
24 changes: 24 additions & 0 deletions home/modules/git.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{ config, pkgs, ... }:

{
# Git package
home.packages = with pkgs; [
git
gh # GitHub CLI
lazygit
];

# Git configuration via XDG config symlink
# This allows sharing the same config with macOS via GNU Stow
# Symlinks entire git config directory to include config.local and other files
xdg.configFile."git".source = config.lib.file.mkOutOfStoreSymlink
"${config.home.homeDirectory}/dotfiles/git/.config/git";

# GitHub CLI
programs.gh = {
enable = true;
settings = {
git_protocol = "ssh";
};
};
}
8 changes: 1 addition & 7 deletions home/nixos-native.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
./modules/common.nix
./modules/shell.nix
./modules/dev-tools.nix
./modules/git.nix
./modules/neovim.nix
./modules/terminal.nix
./modules/editors.nix
Expand All @@ -25,13 +26,6 @@
# Add more GUI apps as needed
];

# Git configuration
programs.git = {
enable = true;
userName = "user3301";
userEmail = "26126682+user3301@users.noreply.github.com";
};

# Home Manager state version
home.stateVersion = "24.05";
}
20 changes: 1 addition & 19 deletions home/nixos-wsl.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
./modules/common.nix
./modules/shell.nix
./modules/dev-tools.nix
./modules/git.nix
./modules/neovim.nix
./modules/terminal.nix
./modules/editors.nix
Expand All @@ -28,25 +29,6 @@
# Add any WSL-specific environment variables
};

# Git configuration for WSL
programs.git = {
enable = true;
signing = {
key = "23B0107B5D3811FB";
signByDefault = true;
};
settings = {
user = {
name = "user3301";
email = "26126682+user3301@users.noreply.github.com";
};
core = {
# Handle Windows line endings
autocrlf = "input";
};
};
};

# GPG configuration
programs.gpg = {
enable = true;
Expand Down