flake.nix: wrap hydraJobs to enable hydra-build-products
makes these files downloadable through the Hydra web interface
This commit is contained in:
parent
4b8b1a9382
commit
bc65da708d
32
flake.nix
32
flake.nix
|
@ -53,5 +53,37 @@
|
||||||
|
|
||||||
# For `nix flake check`, and Hydra
|
# For `nix flake check`, and Hydra
|
||||||
checks = self.packages;
|
checks = self.packages;
|
||||||
|
|
||||||
|
hydraJobs =
|
||||||
|
with self.lib;
|
||||||
|
let
|
||||||
|
exportFileWrapper = pkg:
|
||||||
|
hydraJob (
|
||||||
|
nixpkgs.legacyPackages.${system}.runCommand "${pkg.name}-exported" {
|
||||||
|
src = pkg;
|
||||||
|
} ''
|
||||||
|
NAME="${pkg.name}"
|
||||||
|
mkdir -p $out/nix-support
|
||||||
|
ln -s ${pkg} $out/$NAME
|
||||||
|
echo file source-dist $out/$NAME >> $out/nix-support/hydra-build-products
|
||||||
|
''
|
||||||
|
);
|
||||||
|
wrappers = {
|
||||||
|
"all-device-scripts" = pkg:
|
||||||
|
hydraJob pkg;
|
||||||
|
|
||||||
|
"export-config" = exportFileWrapper;
|
||||||
|
".*-pillar" = exportFileWrapper;
|
||||||
|
"switch-.*" = exportFileWrapper;
|
||||||
|
"ap.*" = exportFileWrapper;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
builtins.mapAttrs (name: pkg:
|
||||||
|
builtins.foldl' (result: wrapperName:
|
||||||
|
if builtins.match wrapperName name != null
|
||||||
|
then wrappers.${wrapperName} pkg
|
||||||
|
else result
|
||||||
|
) pkg (builtins.attrNames wrappers)
|
||||||
|
) self.packages.${system};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user