From 2ffdd53d86157ea83a867b544e7bedf89797b72b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Bon=C3=A9?= Date: Mon, 23 Jun 2025 11:14:57 +0200 Subject: [PATCH] Add hydraJobs with tests and packages Reviewed-by: Rodrigo Arias Mallo Tested-by: Rodrigo Arias Mallo --- flake.nix | 18 ++++++++++++------ overlay.nix | 6 ++++-- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index dc03735..b03734a 100644 --- a/flake.nix +++ b/flake.nix @@ -2,17 +2,23 @@ inputs.nixpkgs.url = "nixpkgs"; outputs = { self, nixpkgs, ...}: - let - pkgs = import nixpkgs { + let # For now we only support x86 system = "x86_64-linux"; - overlays = [ self.overlays.default ]; - }; - in + pkgs = import nixpkgs { + inherit system; + overlays = [ self.overlays.default ]; + }; + in { bscOverlay = import ./overlay.nix; overlays.default = self.bscOverlay; - legacyPackages.x86_64-linux = pkgs; + # full nixpkgs with our overlay applied + legacyPackages.${system} = pkgs; + + hydraJobs = { + inherit (self.legacyPackages.${system}.bsc-ci) test pkgs; + }; # propagate nixpkgs lib, so we can do bscpkgs.lib inherit (nixpkgs) lib; diff --git a/overlay.nix b/overlay.nix index d4ea269..e342da7 100644 --- a/overlay.nix +++ b/overlay.nix @@ -88,7 +88,9 @@ in bscPkgs // { }; }; - pkgs = final.runCommand "ci-pkgs" { } + pkgs = filterAttrs (_: isDerivation) bscPkgs; + + pkgsList = final.runCommand "ci-pkgs" { } "printf '%s\n' ${toString (collect isDerivation bscPkgs)} > $out"; tests = final.runCommand "ci-tests" { } @@ -96,7 +98,7 @@ in bscPkgs // { all = final.runCommand "ci-all" { } '' - deps="${toString [ final.bsc-ci.pkgs final.bsc-ci.tests ]}" + deps="${toString [ final.bsc-ci.pkgsList final.bsc-ci.tests ]}" cat $deps printf '%s\n' $deps > $out '';