Skip to content

Commit

Permalink
feat(tools): deduplicate sources by URL
Browse files Browse the repository at this point in the history
  • Loading branch information
tilpner authored and kolloch committed Oct 14, 2023
1 parent d1a7bf2 commit 0f8633d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,9 @@ rec {
replace-with = "vendored-sources"
'';
gitSources = packagesByType."git" or [ ];
gitSourcesUnique = lib.unique gitSources;
uniqueBy = f:
lib.foldl' (acc: e: if lib.elem (f e) (map f acc) then acc else acc ++ [ e ]) [];
gitSourcesUnique = uniqueBy (c: c.source) gitSources;
gitSourceConfigs = builtins.map gitSourceConfig gitSourcesUnique;
gitSourceConfigsString = lib.concatStrings gitSourceConfigs;
in
Expand Down

0 comments on commit 0f8633d

Please sign in to comment.