1
0
Fork 0

git: Inline conditional config

This commit is contained in:
Daniel Kempkens 2022-08-23 23:33:04 +02:00
parent d5ce6ddf2a
commit 7f28fe14e5
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM
3 changed files with 45 additions and 37 deletions

View file

@ -1,16 +0,0 @@
[user]
email = "d.kempkens@nedeco.de"
name = "Daniel Kempkens"
signingKey = "~/.ssh/nedeco_gitlab.pub"
[commit]
gpgsign = true
[tag]
gpgsign = true
[gpg]
format = "ssh"
[gpg "ssh"]
allowedSignersFile = "~/.ssh/allowed_signers/work-nedeco"

View file

@ -1,9 +0,0 @@
[user]
email = "d.kempkens@wdw-consulting.com"
name = "Daniel Kempkens"
[commit]
gpgsign = false
[tag]
gpgsign = false

View file

@ -1,9 +1,5 @@
{ pkgs, config, ... }:
{ pkgs, ... }:
let
config-work-nedeco = "${config.xdg.configHome}/git/config-work-nedeco";
config-work-wdw = "${config.xdg.configHome}/git/config-work-wdw";
in
{
home.packages = [ pkgs.git-crypt ];
@ -58,20 +54,57 @@ in
];
includes = [
# Private
{
path = "${config-work-nedeco}";
condition = "gitdir:~/Code/Work/";
condition = "hasconfig:remote.*.url:git@github.com:*/**";
contents = {
user = {
signingKey = "~/.ssh/GitHub.pub";
};
commit = {
gpgSign = true;
};
tag = {
gpgSign = true;
};
gpg = {
format = "ssh";
};
};
}
# Work
{
path = "${config-work-wdw}";
condition = "gitdir:~/Code/Work/WDW/";
condition = "hasconfig:remote.*.url:git@git.app.nedeco.de:*/**";
contents = {
user = {
email = "d.kempkens@nedeco.de";
name = "Daniel Kempkens";
signingKey = "~/.ssh/nedeco_gitlab.pub";
};
commit = {
gpgSign = true;
};
tag = {
gpgSign = true;
};
gpg = {
format = "ssh";
};
"gpg \"ssh\"" = {
allowedSignersFile = "~/.ssh/allowed_signers/work-nedeco";
};
};
}
];
};
home.sessionVariables.GIT_CEILING_DIRECTORIES = "/Users";
home.file."${config-work-nedeco}".source = ../config/git/config-work-nedeco;
home.file."${config-work-wdw}".source = ../config/git/config-work-wdw;
}