Compare commits

...

3 Commits

Author SHA1 Message Date
cf3543690d
Make lib imports in overlay explicit 2025-09-29 12:54:22 +02:00
46524cd2ec
Set strictDeps=true on our top level packages 2025-09-29 12:54:22 +02:00
2ffdd53d86 Add hydraJobs with tests and packages
Reviewed-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
Tested-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2025-09-26 16:12:46 +02:00
2 changed files with 24 additions and 12 deletions

View File

@ -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;

View File

@ -1,15 +1,19 @@
final: /* Future last stage */
prev: /* Previous stage */
with final.lib;
let
callPackage = final.callPackage;
inherit (prev.lib) collect isDerivation mapAttrs;
inherit (final) callPackage;
mkDeps = name: pkgs: final.runCommand name { }
"printf '%s\n' ${toString (collect (x: x ? outPath) pkgs)} > $out";
bscPkgs = {
mkStrict = drv: if (isDerivation drv && drv ? overrideAttrs && !(drv ? strictDeps))
then drv.overrideAttrs { strictDeps = true; }
else drv;
bscPkgs = mapAttrs (_: mkStrict) {
bench6 = callPackage ./pkgs/bench6/default.nix { };
bigotes = callPackage ./pkgs/bigotes/default.nix { };
clangOmpss2 = callPackage ./pkgs/llvm-ompss2/default.nix { };
@ -88,7 +92,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 +102,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
'';