.files/nix/git-identities/git-compat.nix

14 lines
372 B
Nix

let
hasconfigRemoteCondition = {
# Custom arguments
url,
path ? "*/**",
...
} @ cfg: let
cfg' = builtins.removeAttrs cfg ["url" "path"];
in [
(cfg' // {condition = "hasconfig:remote.*.url:git@${url}:${path}";})
(cfg' // {condition = "hasconfig:remote.*.url:https://${url}/${path}";})
];
in
builtins.concatMap hasconfigRemoteCondition