mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
vanadium/git: generate git conditional config for both https and git
This commit is contained in:
parent
bdf7dd7122
commit
4cc165fd7f
1 changed files with 19 additions and 11 deletions
|
|
@ -41,8 +41,13 @@
|
|||
];
|
||||
};
|
||||
includes = let
|
||||
hasconfigRemoteCondition = cfg:
|
||||
cfg // {condition = "hasconfig:remote.*.url:" + cfg.condition;};
|
||||
hasconfigRemoteCondition = cfg: let
|
||||
cfg' = builtins.removeAttrs cfg ["url" "path"];
|
||||
path = cfg.path or "*/**";
|
||||
in [
|
||||
(cfg' // {condition = "hasconfig:remote.*.url:git@${cfg.url}:${path}";})
|
||||
(cfg' // {condition = "hasconfig:remote.*.url:https://${cfg.url}/${path}";})
|
||||
];
|
||||
|
||||
haskellIdentity = {
|
||||
init.defaultBranch = "main";
|
||||
|
|
@ -62,30 +67,33 @@
|
|||
blame.ignoreRevsFile = ".git-blame-ignore-revs";
|
||||
};
|
||||
in
|
||||
map hasconfigRemoteCondition [
|
||||
builtins.concatMap hasconfigRemoteCondition [
|
||||
# Univ stuff
|
||||
{
|
||||
condition = "git@gitlab.istic.univ-rennes1.fr";
|
||||
url = "gitlab.istic.univ-rennes1.fr";
|
||||
contents = universityIdentity;
|
||||
}
|
||||
{
|
||||
condition = "git@gitlab2.istic.univ-rennes1.fr";
|
||||
url = "gitlab2.istic.univ-rennes1.fr";
|
||||
contents = universityIdentity;
|
||||
}
|
||||
|
||||
# Haskell
|
||||
{
|
||||
condition = "git@gitlab.haskell.org:*/**";
|
||||
contents = lib.mkMerge [
|
||||
haskellIdentity
|
||||
blameIgnore
|
||||
];
|
||||
url = "gitlab.haskell.org";
|
||||
contents = haskellIdentity;
|
||||
}
|
||||
|
||||
# Blame
|
||||
# Turning this on globally will fail if the file doesn't exist
|
||||
{
|
||||
condition = "git@github.com:nixos/nixpkgs.git";
|
||||
url = "github.com";
|
||||
path = "nixos/nixpkgs.git";
|
||||
contents = blameIgnore;
|
||||
}
|
||||
{
|
||||
url = "gitlab.haskell.org";
|
||||
path = "ghc/ghc.git";
|
||||
contents = blameIgnore;
|
||||
}
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue