rose-pine-nix/.github/checkSources.nix
2024-05-21 22:53:46 +01:00

12 lines
531 B
Nix

let
sources = (builtins.fromJSON (builtins.readFile ../.sources/sources.json)).pins;
isGithubSource = source: source.repository.type or "" == "GitHub";
isInOrg = source: source.repository.owner or "" == "catppuccin";
# all github sources should be from the org
isGoodSource = source: isGithubSource source -> isInOrg source;
# find the ones that aren't
badSources = builtins.filter (source: !(isGoodSource source)) (builtins.attrValues sources);
in
if ((builtins.length badSources) == 0) then "OK" else throw "BAD"