-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathversions.nix
28 lines (28 loc) · 948 Bytes
/
versions.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
let
flake = builtins.getFlake "${toString ./.}";
pkgs = flake.pkgs."${builtins.currentSystem}".nixpkgs;
lib = pkgs.lib;
customPkgs = flake.packages."${builtins.currentSystem}";
in
builtins.map (pkg: let
repo = pkg.src.gitRepoUrl or "";
in
if lib.strings.hasPrefix "https://github.com" repo
then rec {
inherit repo;
name = pkg.name;
rev = pkg.src.rev or null;
homepage = pkg.src.meta.homepage or null;
position = pkg.src.meta.position or null;
gh =
#builtins.fromJSON (builtins.readFile
pkgs.runCommand "${name}-gh-release-list-head" {
GH_TOKEN = builtins.getEnv "GH_TOKEN";
buildInputs = [pkgs.gh pkgs.jq];
} ''
echo ${name}
# ${pkgs.gh}/bin/gh auth login
${pkgs.gh}/bin/gh release list --json name,tagName -R ${repo} | jq -r '.[0]' | tee $out
''; #);
}
else null) (builtins.attrValues customPkgs)