feat: create shared git config

This commit is contained in:
Felix Schröter 2020-03-13 21:18:08 +01:00 committed by Felix Schroeter
parent b567c83f95
commit b220300e0c
3 changed files with 44 additions and 22 deletions

View file

@ -6,6 +6,7 @@ with pkgs;
./shell ./shell
./editors ./editors
./desktop ./desktop
./git.nix
./keybase.nix ./keybase.nix
./signal.nix ./signal.nix
./chromium.nix ./chromium.nix
@ -34,19 +35,10 @@ with pkgs;
programs.gpg.enable = true; programs.gpg.enable = true;
programs.git = { programs.git.custom = {
enable = true;
userName = "Felix Schroeter"; userName = "Felix Schroeter";
userEmail = "fs@upsquared.com"; userEmail = "fs@upsquared.com";
ignores = [".direnv"]; signingKey = "6DA1 4A05 C6E0 7DBE EB81 BA24 28ED 46BC B881 7B7A";
signing = {
key = "6DA1 4A05 C6E0 7DBE EB81 BA24 28ED 46BC B881 7B7A";
signByDefault = true;
};
extraConfig = {
pull = { rebase = true; };
rebase = { autoStash = true; };
};
}; };
programs.firefox.enable = true; programs.firefox.enable = true;

View file

@ -6,6 +6,7 @@ with pkgs;
./shell ./shell
./editors ./editors
./desktop ./desktop
./git.nix
./keybase.nix ./keybase.nix
./signal.nix ./signal.nix
./chromium.nix ./chromium.nix
@ -37,19 +38,10 @@ with pkgs;
programs.gpg.enable = true; programs.gpg.enable = true;
programs.git = { programs.git.custom = {
enable = true;
userName = "Felix Tenley"; userName = "Felix Tenley";
userEmail = "dev@felschr.com"; userEmail = "dev@felschr.com";
ignores = [".direnv"]; signingKey = "22A6 DD21 EE66 E73D D4B9 3F20 A12D 7C9D 2FD3 4458";
signing = {
key = "22A6 DD21 EE66 E73D D4B9 3F20 A12D 7C9D 2FD3 4458";
signByDefault = true;
};
extraConfig = {
pull = { rebase = true; };
rebase = { autoStash = true; };
};
}; };
home.packages = with pkgs; [ home.packages = with pkgs; [

38
home/git.nix Normal file
View file

@ -0,0 +1,38 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.programs.git.custom;
in
{
options.programs.git.custom = {
userName = mkOption {
type = types.str;
default = "Felix Tenley";
};
userEmail = mkOption {
type = types.str;
default = "dev@felschr.com";
};
signingKey = mkOption {
type = types.str;
};
};
config = {
programs.git = {
enable = true;
userName = cfg.userName;
userEmail = cfg.userEmail;
ignores = [".direnv"];
signing = {
key = cfg.signingKey;
signByDefault = true;
};
extraConfig = {
pull = { rebase = true; };
rebase = { autoStash = true; };
};
};
};
}