Skip to content

Commit

Permalink
chore(git): Multiple accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanmoy committed Jun 16, 2024
1 parent f4be6d3 commit d9fdf22
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 5 deletions.
5 changes: 4 additions & 1 deletion home-manager/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@
username = "bryanmoy";
homeDirectory = "/home/bryanmoy";
file = {
".ssh/allowed_signers".text = "* ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPvMq/Zpl7z9G5EOv9lfI7XK+U4SnNSq9PMGU6Kv7SaC";
".ssh/allowed_signers".text = ''
* ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPvMq/Zpl7z9G5EOv9lfI7XK+U4SnNSq9PMGU6Kv7SaC
* ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIPIMS9BLKjX1mGPdGaREThg48e6I5+QbMbzYWV4nHoU
'';
};
};

Expand Down
21 changes: 17 additions & 4 deletions modules/home-manager/git/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,28 @@
with lib; let
cfg = config.modules.git;
in {
options.modules.git = {enable = mkEnableOption "git";};
options.modules.git = {
enable = mkEnableOption "git";
};
config = mkIf cfg.enable {
programs.git = {
enable = true;
userName = "Bryan Moy";
userEmail = "[email protected]";
includes = [
{
path = "~/.dotfiles/nixos-config/modules/home-manager/git/personal.gitconfig";
condition = "gitdir:~/.dotfiles/";
}
{
path = "~/.dotfiles/nixos-config/modules/home-manager/git/personal.gitconfig";
condition = "gitdir:~/PersonalProjects/";
}
{
path = "~/.dotfiles/nixos-config/modules/home-manager/git/qonto.gitconfig";
condition = "gitdir:~/QontoProjects/";
}
];
extraConfig = {
init.defaultBranch = "main";
user.signingkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPvMq/Zpl7z9G5EOv9lfI7XK+U4SnNSq9PMGU6Kv7SaC";
commit.gpgsign = true;
tag.gpgsign = true;
gpg.format = "ssh";
Expand Down
4 changes: 4 additions & 0 deletions modules/home-manager/git/personal.gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[user]
name = Bryan Moy
email = [email protected]
signingkey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPvMq/Zpl7z9G5EOv9lfI7XK+U4SnNSq9PMGU6Kv7SaC
7 changes: 7 additions & 0 deletions modules/home-manager/git/qonto.gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[user]
name = Bryan Moy
email = [email protected]
signingkey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIPIMS9BLKjX1mGPdGaREThg48e6I5+QbMbzYWV4nHoU

[init]
defaultBranch = "master"

0 comments on commit d9fdf22

Please sign in to comment.