mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49:14 +00:00
vanadium: refactor git identity configuration
This commit is contained in:
parent
d3b5bd3197
commit
78746867ba
2 changed files with 49 additions and 28 deletions
|
|
@ -40,6 +40,55 @@
|
||||||
"r/nixos/nixpkgs"
|
"r/nixos/nixpkgs"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
includes = let
|
||||||
|
hasconfigRemoteCondition = cfg:
|
||||||
|
cfg // {condition = "hasconfig:remote.*.url:" + cfg.condition;};
|
||||||
|
|
||||||
|
haskellIdentity = {
|
||||||
|
init.defaultBranch = "main";
|
||||||
|
user.name = "Léana Jiang";
|
||||||
|
};
|
||||||
|
|
||||||
|
universityIdentity = {
|
||||||
|
init.defaultBranch = "main";
|
||||||
|
user = {
|
||||||
|
name = "Léana CHIANG";
|
||||||
|
email = "leana.chiang@etudiant.univ-rennes1.fr";
|
||||||
|
signingKey = "0x32035DB97E777EEB";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
blameIgnore = {
|
||||||
|
blame.ignoreRevsFile = ".git-blame-ignore-revs";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
map hasconfigRemoteCondition [
|
||||||
|
# Univ stuff
|
||||||
|
{
|
||||||
|
condition = "gitlab.istic.univ-rennes1.fr";
|
||||||
|
contents = universityIdentity;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
condition = "gitlab2.istic.univ-rennes1.fr";
|
||||||
|
contents = universityIdentity;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Haskell
|
||||||
|
{
|
||||||
|
condition = "git@gitlab.haskell.org:*/**";
|
||||||
|
contents = lib.mkMerge [
|
||||||
|
haskellIdentity
|
||||||
|
blameIgnore
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
# Blame
|
||||||
|
# Turning this on globally will fail if the file doesn't exist
|
||||||
|
{
|
||||||
|
condition = "git@github.com:nixos/nixpkgs.git";
|
||||||
|
contents = blameIgnore;
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.gpg.enable = true;
|
programs.gpg.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -59,32 +59,4 @@
|
||||||
signByDefault = lib.mkDefault false;
|
signByDefault = lib.mkDefault false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.git.includes = let
|
|
||||||
mkIdentity = condition: contents: {inherit condition contents;};
|
|
||||||
hostCondition = url: "hasconfig:remote.*.url:git@${url}:*/**";
|
|
||||||
|
|
||||||
universityIdentity = {
|
|
||||||
init.defaultBranch = "main";
|
|
||||||
user = {
|
|
||||||
name = "Léana CHIANG";
|
|
||||||
email = "leana.chiang@etudiant.univ-rennes1.fr";
|
|
||||||
signingKey = "0x32035DB97E777EEB";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
haskellIdentity = {
|
|
||||||
init.defaultBranch = "main";
|
|
||||||
user.name = "Léana Jiang";
|
|
||||||
};
|
|
||||||
in [
|
|
||||||
(mkIdentity
|
|
||||||
(hostCondition "gitlab.istic.univ-rennes1.fr")
|
|
||||||
universityIdentity)
|
|
||||||
(mkIdentity
|
|
||||||
(hostCondition "gitlab2.istic.univ-rennes1.fr")
|
|
||||||
universityIdentity)
|
|
||||||
(mkIdentity
|
|
||||||
(hostCondition "gitlab.haskell.org")
|
|
||||||
haskellIdentity)
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue