flake.nix: refactor for hydraJobs

This commit is contained in:
Astro 2021-03-10 01:11:12 +01:00
parent a5e807783a
commit cd4a8fce8a
1 changed files with 32 additions and 17 deletions

View File

@ -30,13 +30,12 @@
"x86_64-linux"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
in rec {
packages = forAllSystems (system:
artiq-jobsets = system: artiqInputName: a6p:
let
pkgs = nixpkgs.legacyPackages.${system};
artiq-fast-src = artiqInputName:
artiq-fast-src =
let
inherit (sources.${artiqInputName}) lastModified rev narHash;
hash = builtins.replaceStrings ["sha256-"] [""] narHash;
@ -64,35 +63,51 @@
echo "{ stdenv, git, fetchgit }: \"$MAJOR_VERSION.`cut -c1-8 <<< ${rev}`$SUFFIX\"" > $out/pkgs/artiq-version.nix
echo "{ stdenv, git, fetchgit }: \"${toString lastModified}\"" > $out/pkgs/artiq-timestamp.nix
'';
artiq-fast = artiqInputName:
import (artiq-fast-src artiqInputName) {
artiq-fast =
import artiq-fast-src {
inherit pkgs;
};
artiq-board-generated = artiqInputName:
artiq-board-generated =
(import ./artiq-board-generated {
inherit pkgs;
sinaraSystemsSrc = null; #sources.sinara-systems.outPath;
sinaraSystemsRev = sources.sinara-systems.rev;
sinaraSystemsHash = builtins.replaceStrings ["sha256-"] [""]
sources.sinara-systems.narHash;
artiq-fast = artiq-fast-src artiqInputName;
artiq-fast = artiq-fast-src;
}).generated-nix;
artiq-full = artiqInputName: a6p:
artiq-full =
import ./artiq-full.nix {
inherit pkgs;
inherit a6p;
artiq-board-generated = artiq-board-generated artiqInputName;
artiq-fast = artiq-fast-src artiqInputName;
inherit pkgs a6p artiq-board-generated;
artiq-fast = artiq-fast-src;
};
allPackages = artiqInputName: a6p:
(artiq-fast artiqInputName) //
(artiq-full artiqInputName a6p);
in allPackages "artiq-beta-src" true
in {
inherit artiq-fast artiq-full;
};
in {
packages = forAllSystems (system:
builtins.foldl' (a: b: a // b) {} (
builtins.attrValues (
artiq-jobsets system "artiq-beta-src" true
)
)
);
defaultPackage = forAllSystems (system: self.packages.${system}.artiq);
hydraJobs =
let
jobset = artiqInputName: a6p: name:
forAllSystems (system: (artiq-jobsets system artiqInputName a6p).${name});
in {
fast = jobset "artiq-src" true "artiq-fast";
fast-beta = jobset "artiq-beta-src" true "artiq-fast";
fast-legacy = jobset "artiq-legacy-src" false "artiq-fast";
full = jobset "artiq-src" true "artiq-full";
full-beta = jobset "artiq-beta-src" true "artiq-full";
full-legacy = jobset "artiq-legacy-src" false "artiq-full";
};
};
}