mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49: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
|
includes = let
|
||||||
hasconfigRemoteCondition = cfg:
|
hasconfigRemoteCondition = cfg: let
|
||||||
cfg // {condition = "hasconfig:remote.*.url:" + cfg.condition;};
|
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 = {
|
haskellIdentity = {
|
||||||
init.defaultBranch = "main";
|
init.defaultBranch = "main";
|
||||||
|
|
@ -62,30 +67,33 @@
|
||||||
blame.ignoreRevsFile = ".git-blame-ignore-revs";
|
blame.ignoreRevsFile = ".git-blame-ignore-revs";
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
map hasconfigRemoteCondition [
|
builtins.concatMap hasconfigRemoteCondition [
|
||||||
# Univ stuff
|
# Univ stuff
|
||||||
{
|
{
|
||||||
condition = "git@gitlab.istic.univ-rennes1.fr";
|
url = "gitlab.istic.univ-rennes1.fr";
|
||||||
contents = universityIdentity;
|
contents = universityIdentity;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
condition = "git@gitlab2.istic.univ-rennes1.fr";
|
url = "gitlab2.istic.univ-rennes1.fr";
|
||||||
contents = universityIdentity;
|
contents = universityIdentity;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Haskell
|
# Haskell
|
||||||
{
|
{
|
||||||
condition = "git@gitlab.haskell.org:*/**";
|
url = "gitlab.haskell.org";
|
||||||
contents = lib.mkMerge [
|
contents = haskellIdentity;
|
||||||
haskellIdentity
|
|
||||||
blameIgnore
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Blame
|
# Blame
|
||||||
# Turning this on globally will fail if the file doesn't exist
|
# 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;
|
contents = blameIgnore;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue