mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
76 lines
1.6 KiB
Nix
76 lines
1.6 KiB
Nix
{lib, ...}: {
|
|
# git plugins
|
|
programs.git = {
|
|
lfs.enable = true;
|
|
patdiff.enable = true;
|
|
};
|
|
|
|
# git itself
|
|
programs.git = {
|
|
extraConfig = {
|
|
init.defaultBranch = "trunk"; # I like trees
|
|
push.autoSetupRemote = true;
|
|
pull.ff = "only";
|
|
rerere.enabled = true;
|
|
};
|
|
ignores = [
|
|
# sanity
|
|
".env"
|
|
|
|
# vim
|
|
"*~"
|
|
"*.swp"
|
|
|
|
# darwin
|
|
".DS_Store"
|
|
|
|
# nix
|
|
".direnv/"
|
|
"**/result*" # building an attr of derivation will make multiple links
|
|
|
|
# pre-commit
|
|
".pre-commit-config.yaml"
|
|
|
|
# dotfiles
|
|
".config/nvim/spell/"
|
|
];
|
|
};
|
|
|
|
# identity
|
|
programs.git = {
|
|
userEmail = "leana.jiang+git@icloud.com";
|
|
userName = "Léana 江";
|
|
signing = {
|
|
key = "0x4E887A4CA9714ADA";
|
|
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)
|
|
];
|
|
}
|