1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-09 03:43:54 +02:00

Setup uploading PRs, tags, and branches to IDS

This commit is contained in:
Cole Helbling 2025-02-20 14:00:48 -08:00
parent d712540206
commit 90581c9d66
6 changed files with 178 additions and 1 deletions

View file

@ -294,6 +294,37 @@
nix-manual = nixpkgsFor.${system}.native.nixComponents.nix-manual;
nix-internal-api-docs = nixpkgsFor.${system}.native.nixComponents.nix-internal-api-docs;
nix-external-api-docs = nixpkgsFor.${system}.native.nixComponents.nix-external-api-docs;
fallbackPathsNix =
let
pkgs = nixpkgsFor.${system}.native;
# NOTE(cole-h): discard string context so that it doesn't try to build, we just care about the outPaths
closures = forAllSystems (system: builtins.unsafeDiscardStringContext self.packages.${system}.default.outPath);
closures_json = pkgs.runCommand "versions.json"
{
buildInputs = [ pkgs.jq ];
passAsFile = [ "json" ];
json = builtins.toJSON closures;
} ''
cat "$jsonPath" | jq . > $out
'';
closures_nix = pkgs.runCommand "versions.nix"
{
buildInputs = [ pkgs.jq ];
passAsFile = [ "template" ];
jsonPath = closures_json;
template = ''
builtins.fromJSON('''@closures@''')
'';
} ''
export closures=$(cat "$jsonPath");
substituteAll "$templatePath" "$out"
'';
in
closures_nix;
}
# We need to flatten recursive attribute sets of derivations to pass `flake check`.
//