mirror of
https://codeberg.org/leana8959/.files.git
synced 2026-02-01 22:49:41 +00:00
tree-wide: deduplicate git identity
This commit is contained in:
parent
432efd430c
commit
50db96001e
4 changed files with 73 additions and 127 deletions
14
nix/git-identities/git-compat.nix
Normal file
14
nix/git-identities/git-compat.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue